In this program user ask to reverse the 10 digit number. To reverse the digit user declares the variables for storing the value in it so far. User asks to put out the 10 digit value on double quoted premises. The after user declare the while condition while (a!=0). Then if the given condition rely on the situation the variable b=a%10. Then after user print out the result on the screen.
This is C program that asks user to reverse a 10 digit number.
- Declare variable.
- Using the while condition.
- Display result on the screen.
Here is C source code for reversing the 10 digit number. Output of this program shown below.
void main ()
long int a,b,r=0;
printf ("\nInput a 10 Digit Number : ");
printf ("\nThe Reverse of the Number is : %ld",r);
Input a 10 Digit Number : 1234567890
The Reverse of the Number is : 987654321