#include<stdio.h>
#include<conio.h>
main()
{
int n,r,sum=0;
clrscr();
printf("enter the number to reverse the number");
scanf("%d",&n);
while(n!=0)
{
r=n%10;
sum=(sum*10)+r;
n=n/10;
}
printf("the reverse number is"+sum);
}
OUTPUT:
enter the number to reverse the number 345
the reverse number is 543
#include<conio.h>
main()
{
int n,r,sum=0;
clrscr();
printf("enter the number to reverse the number");
scanf("%d",&n);
while(n!=0)
{
r=n%10;
sum=(sum*10)+r;
n=n/10;
}
printf("the reverse number is"+sum);
}
OUTPUT:
enter the number to reverse the number 345
the reverse number is 543
No comments:
Post a Comment