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