G
gk245
I have this:
#include <stdio.h>
int main (void)
{
int number;
printf ("Enter number: ");
scanf ("%i", &number);
printf ("%05i", number);
return 0;
}
So, if i enter a number like '00768', it should print out the same
'00768'. But its not doing that...its printing out 5 zeros instead.
I have tried using %06d, %.5i, %.5d in the printf statement. None of
them work properly. I can't use any bigger functions, just printf to
do this. Thanks.
#include <stdio.h>
int main (void)
{
int number;
printf ("Enter number: ");
scanf ("%i", &number);
printf ("%05i", number);
return 0;
}
So, if i enter a number like '00768', it should print out the same
'00768'. But its not doing that...its printing out 5 zeros instead.
I have tried using %06d, %.5i, %.5d in the printf statement. None of
them work properly. I can't use any bigger functions, just printf to
do this. Thanks.