#include<stdio.h>
int main()
{
int a,b,c,d,x,m,rev;
printf("Enter four digit numbers\n");
scanf("%d",&x);
m=x;
a=x%10;
x=x/10;
b=x%10;
x=x/10;
c=x%10;
x=x/10;
d=x%10;
x=x/10;
rev=a*1000+b*100+c*10+d;
printf("Reverse of digit %d is=%d",m,rev);
}
OUTPUT
Enter four digit numbers
6789
Reverse of digit 6789 is=9876
Comments
Post a Comment