2
4
6
8
9
#include<stdio.h>
#include<conio.h>
int main()
{
int n,r,rev=0;
printf("Enter a number\n");
scanf("%d",&n);
// finding reverse
while(n!=0)
{
r=n%10;
rev=rev*10+r;
n=n/10;
}
// printing of number
while(rev!=0)
{
r=rev%10;
rev=rev/10;
printf("%d\n",r);
}
getch();
return 0;
}
Enter a number
8547
8
5
4
7
--------------------------------
Process exited after 5.539 seconds with return value 0
Press any key to continue . . .