1#include <iostream>
2#include <stdlib.h>
3
4int main ()
5{
6 int i;
7 char buffer [33];
8 printf ("Enter a number: ");
9 scanf ("%d",&i);
10 itoa (i,buffer,10);
11 printf ("decimal: %s\n",buffer);
12 itoa (i,buffer,16);
13 printf ("hexadecimal: %s\n",buffer);
14 itoa (i,buffer,2);
15 printf ("binary: %s\n",buffer);
16 return 0;
17}
18