Breaking News

Program to reverse a number IN C

#include

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;
}

}

No comments