Friday, October 1, 2010

Code a program to convert decimal input into octal and hexadecimal formats. (with proper prefix for octal (0) and hexadecimal (0x)

int main()
{
int a;
printf("Enter a number:");
scanf("%d",&a);
printf("Octal equivelent of %d is %o\n",a,a);
printf("Hexadecimal equivelent of %d is %x\n",a,a);
getch();
return 0;
}

No comments:

Post a Comment

Google+ Followers