link mingle home | logged in as: guest | login/register| submit link


IndiaDiscuss.com : Social Bookmarkings and News Networking Site for India
interview_questions
Bookmarks
Decimal to Hexa-Decimal
14
Votes

Write a program to convert a decimal number to its hexa-decimal equivalent

saved under Amazon Interview Questions by interview_questions

 
char hex[20] = {'\0'}; int i = 0; while(num) { int x = num % 16; if(x>=0 && x<=9) { hex[i++] = '0' + x; } else { hex[i++] = 'A' + (x % 10); } } hex[i] = '\0'; strrev(hex);
comment by sachidanand on 2009-09-29 10:09:57
 



Enter the string above
 
IndiaDiscuss | Published News | Hot
Indian Social News and Links Network
IndiaDiscuss | Published News
Indian Social News and Links Network