#include<stdio.h>
int reverse(int);
main()
{
int n,b;
printf("Enter a number=");
scanf("%d",&n);
b=reverse(n);
printf("\nThe reverse number=%d",b);
}
int reverse(int a)
{
int rev=0;
while(a)
{
rev=rev*10+a%10;
a=a/10;
}
return rev;
}
int reverse(int);
main()
{
int n,b;
printf("Enter a number=");
scanf("%d",&n);
b=reverse(n);
printf("\nThe reverse number=%d",b);
}
int reverse(int a)
{
int rev=0;
while(a)
{
rev=rev*10+a%10;
a=a/10;
}
return rev;
}
No comments:
Post a Comment