Convert string to long : atol
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i;
char str[256];
printf ("Enter a long number: ");
gets ( str );
i = atol ( str );
printf ("i = %d, its double = %d", i, i * 2 );
return 0;
}
Related examples in the same category