A program which asks from the user an integer as input (inputis stored in ONE in
ID: 3611054 • Letter: A
Question
A program which asks from the user an integer as input (inputis stored in ONE integer variable) and prints thatnumber in the reverse order on the screen (the reversed number tobe displayed must also be stored in ONE integervariable). for example: (output) Enter an integer: 2436891 The integer in reverse order is: 1986342 A program which asks from the user an integer as input (inputis stored in ONE integer variable) and prints thatnumber in the reverse order on the screen (the reversed number tobe displayed must also be stored in ONE integervariable). for example: (output) Enter an integer: 2436891 The integer in reverse order is: 1986342Explanation / Answer
#include <iostream> using namespace std; int main () { system ( "color 3e" ); system ( "title Shafiq" ); int number, revNum; cout << "Please enter any number: "; cin >> number; cout << " The reverse of the number is. "; while ( number ) { revNum = number % 10; number = number / 10; cout << revNum; } system ( "pause" ); return 0;Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.