Â
#include<stdio.h>
int main()
{
int dec, oct, hex;
printf("Enter value in decimal format :");
scanf("%d", &dec);
printf("Enter value in octal format : ");
scanf("%i", &oct);
printf("Enter value in hexadecimal format : ");
scanf("%i", &hex);
/*%d considers the base as 10 but %i auto-detects the base when used*/
printf("dec = %i, oct = %i, hex = %i", dec, oct, hex);
return 0;
}
//..........Coded by RISHAB NAIR
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP