printf ("\n Conversion of Decimal to Hexadecimal Number \n");
for(;;)
i
if (x==0)
exit(l);
z=x%16;
x=x/16;
gotoxy(y~,5);
switch(z)
I
case 10:
printf ("A/f);
break;
case 11:
printf ("%c"/B');
break;
case 12:
printf (“%c","C");
break;
case 13:
printf ("D");
break;
case 14:
printf ("E");
break;
case 15:
printf (“F");
break;
default:
printf ("%d",z);
I
QUTFUT;
Enter a number: 31
Conversion of Decimal to Hexadecimal Number
IF
ExplanationIn the above program an infinite forloop is used. In the for loop switch () case
statement is used for printing the characters A to F when re ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.