This code is using for revese an integer number.
Sample Input : 12345
Output : 54321
Code is :
#include<stdio.h>
int main()
{
int Num1,b;
printf("\n\tEnter Number to Reverse : ");
scanf("%d",&Num1);
printf("\n\tReverse is : ");
while(Num1!=0)
{
b=Num1%10;
printf("%d",b);
Num1=Num1/10;
}
}
int main()
{
int Num1,b;
printf("\n\tEnter Number to Reverse : ");
scanf("%d",&Num1);
printf("\n\tReverse is : ");
while(Num1!=0)
{
b=Num1%10;
printf("%d",b);
Num1=Num1/10;
}
}
No comments:
Post a Comment