Write a program that generates a random number between 1000 and9999, displays the random number, the random
Fantastic news! We've Found the answer you've been seeking!
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 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++
Related Book For
Posted Date: