CSIT139 C++ 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 =

This problem has been solved!


Do you need an answer to a question different from the above? Ask your question!

CSIT139 C++

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.

Related Book For  answer-question

Matlab An Introduction with Applications

5th edition

Authors: Amos Gilat

ISBN: 978-1118629864