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