hi everyone can you help me how can i upgrade my program I want to input a octal and binary number and convert them in base 2, 8, 10, 16..
how can I write the scanf with the right parameter in it??
Code:scanf ("%x",&i);
Code:#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main()
{
int i;
char buffer [33];
printf ("Enter a number(in hexadecimal): ");
scanf ("%x",&i);
itoa (i,buffer,10);
printf ("Decimal: %s\n",buffer);
itoa (i,buffer,8);
printf ("Octal: %s\n",buffer);
itoa (i,buffer,2);
printf ("Binary: %s\n",buffer);
return 0;
}