Reversing of the number
#include<stdio.h>
#include<conio.h>
void main()
{
int a,r,sum=1;
printf("enter the number");
scanf("%d",&a);
while(a!=0)
{
r=a%10;
sum=sum*10+r;
a=a/10;
}
printf("the reverse number is %d ",sum);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a,r,sum=1;
printf("enter the number");
scanf("%d",&a);
while(a!=0)
{
r=a%10;
sum=sum*10+r;
a=a/10;
}
printf("the reverse number is %d ",sum);
getch();
}
0 comments:
Post a Comment