#include<stdio.h>
#include<conio.h>
#include<process.h>
void main()
{
int x, y=30, z;
clrscr();
printf(“Enter the number:”);
scanf(“%d”, &x);
printf(“\n Conversion of Decimal to Hexadecimal Number\n”);
for(;;)
{
if(x= =0)
exit(1);
z=x%16;
x=x/16;
gotoxy(y--,5);
switch(z)
{
Case 10:
printf(“A”);
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”);
Default:
printf(“%d”, z);
}
}
getch();
}
No comments:
Post a Comment