C Program to calculate the reverse of any number:This is program shows how to find the reverse of any number which is input from user.
In which we find the reverse of number.
For Example: User input the number which is 1592. then the reverse of number is 2951.
ALGORITHM:-
step 1 : Start
step 2 : Input any number from user
step 3 : Find the % mod by 10 and add in another number which
multiplied by 10 and stored in third variable
step 4 : Divide the number by 10
step 5 : Stop
PROGRAM CODE:-
#include<stdio.h>
#include<conio.h>
void main()
{
int num,r,rev=0;
printf("Enter any number : ");
scanf("%d",&num);
while(num)
{
r=num%10;
rev=rev*10+r;
num=num/10;
}
printf("Reversed of number: %d",rev);
getch();
}
OUTPUT:-
Enter any number: 1589
Reversed of number : 9851
C Program to find the reverse of any number How to calculate the reverse of number how to display the number if reverse order
ConversionConversion EmoticonEmoticon