#include<stdio.h>
#include<conio.h>
void main()
{
long int digit,reverse=0;
clrscr();
printf("\nEnter the 5 Digit number: ");
scanf("%ld",&digit);
while(digit>0)
{
reverse*=10;
reverse+=digit%10;
digit/=10;
}
printf("\nThe Reverse is\t\t: %ld",reverse);
getch();
}
Algorithm
step 1: Start
step 2: Intilize reverse=0.
step 3: Read digit
step 4: Check whether digit>0 then go to step 5
else go to step 9
step 5: reverse =reverse *10
step 6: reverse=reverse+digit%10
step 7: digit =digit/10
step 8: Go to step 4
step 9: Print reverse
step 10: Stop