Code:
#include<stdio.h>
#include<conio.h>
main()
{
int x,n;
printf("Enter a
number :");
scanf("%d",&n);
x=reverse(n);
printf("%d",x);
}
int reverse(int n)
{
int s=0;
while(n>0)
{
s=s *10 +
n%10;
n=n/10;
}
return s;
}
Output:
Enter a number :56
65
--------------------------------
Process exited after 8.599 seconds with return value 2
Press any key to continue . . .
65
--------------------------------
Process exited after 8.599 seconds with return value 2
Press any key to continue . . .