C++ Mania
Miscellaneous problems and features of C/C++
Tuesday, December 28, 2010
Write a C program to convert Decimal to Hex
void dec2hex(int num)
{
char hx[16]={"0123456789ABCDEF"};
if(num>15)
{
cout<<(num/16);
dec2hex(num%16);
}
else
cout<<hx[num];
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment