#include <iostream.h>
#include <conio.h>
int main()
{
int n, reversedNumber = 0, remainder;
cout << "Enter an integer: ";
cin >> n;
while(n != 0)
{
remainder = n%10;
reversedNumber = reversedNumber*10 + remainder;
n /= 10;
}
cout << "Reversed Number = " << reversedNumber;
return 0;
}
Output
Enter an integer: 12345
Reversed number = 54321
Tags:
C++ Program to Reverse a five digits Integer number.
c++ programming
list of c++ programs
manjeet singh kuthar
mskuthar
number reverse
reverse a five digits number