#include<stdio.h>
#include<conio.h>
main()
{
int num,d,rev=0;
clrscr();
printf("\n enter the number=");
scanf("\n %d",&num);
while(num)
{
d=num%10;
rev=rev*10+d;
num=num/10;
}
printf("\n reverse number=%d",rev);
getch();
}
output:-enter the number=654
reverse number=456
No comments:
Post a Comment