Hi friends,
I have written a simple program to reverse a number.The code is pasted
below:
#include<stdio.h>
int main()
{
int num, rem ,i =0;
printf("Enter a number:");
scanf("%d", &num);
printf("The reversal is:");
/* For two, three upto nine digits*/
while(num != 0)
{
rem = num%10;
num = num/10;
printf("%d",rem);
}
Then i realized that the above program will reverse only numbers upto 10
digits. Can anyone tell me a solution to get rid of this limit?
Now, I read i/p(number) from command line argv[] as a string.
[Non-text portions of this message have been removed]