/*
Reverse a given number
*/
#include<stdio.h>
void main()
{
int number=125,reverse=0,mod;
printf("Enter A Number.");
scanf("%d",&number);
while(number>0)
{
mod = number%10;
reverse=(reverse*10)+mod;
number = number/10;
}
printf("The Reverse Number Is. %d",reverse);
}
No comments:
Post a Comment