//program to print the digits of the entered number in reverse order #include using namespace std; int main() { int number; int digit; cout << "Enter a positive number -- "; cin >> number; // use remainder and divide to get the digits one at a time and print // note the last digit can be obtained by finding the remainder when // the number is divided by 10. We can then divide the number by 10 to // remove the last digit. We will repeat this until the number is 0 while (number > 0) { digit = number % 10; cout << digit; number = number / 10; } cout << endl; return 0; }