C Program To Find Reverse Of Any Digit Number

How to write a C Program To Find Reverse Of Any Digit Number in C Programming Language ?

Solution For C Program :

/*C Program To Find Reverse Of Any Digit Number.*/

/*It works good up to 9-digits.*/
#include<stdio.h>
#include<conio.h>
void main()
{
long int num,rem,rev=0,num1;
clrscr();
printf("Enter any digit number for reverse===>");
scanf("%ld",&num);
num1=num;
while(num1>0)
{
rem=num1%10;
num1/=10;
rev=rev*10+rem;
}
printf("Reverse of %ld is===>%ld",num,rev);
getch();
}


You may also learn these C Program/Code :

C Program To Swap Two Numbers Without Using Third Variable


Learn More :