I have this code, but it seems to print only last 4 characters of the hexadecimal conversion.
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main ()
{
int i;
char test [33];
printf ("Enter a number: ");
scanf ("%d",&i);
itoa (i,test,16);
printf ("hexadecimal: %s\n",test);
getch();
}
- Input: 3219668508
- Output: 3e1c
- Expected Output: bfe83e1c
HELP?