Question: Write a program that generates a random number between 1000 and9999, displays the random number, the random number with its digitsin reverse order, and the
Write a program that generates a random number between 1000 and9999, displays the random number, the random number with its digitsin reverse order, and the sum of the random number’s digits. Labelyour output.
You can use the modulus operator to remove the number'sright most digit. For example, suppose the number is2147.
digit = number % 10;
new_number = number / 10;
Then digit is 7 and new_number is 214.
If you apply these operations to 214 then new_number is 21 anddigit is 4.
CSIT139 C++
Step by Step Solution
3.57 Rating (164 Votes )
There are 3 Steps involved in it
Answer include include include using namespace std int main int number int digit int newnumber int s... View full answer
Get step-by-step solutions from verified subject matter experts
