Question: In C + + , we can use rand ( ) function ( More details ) to generate random numbers. In the question, we will

In C++, we can use rand() function (More details) to generate random numbers. In the
question, we will generate a 4-digit random number between 1000-9999 and complete
number calculation following the requirements:
Display a welcome message.
Display the randomly generated even/odd number.
Reverse the number.
For example, if the number is 1234, change it to 4321.
Check if the number is a palindrome.
For example, 1221 is a palindrome as it is the same if reversed.
Find the smallest and largest digit in the number
For example, the largest digit is 9 and smallest is 1, in 3179.
Use at least one constant variable to store value in the program.
Following are 2 sample screen shots to illustrate the expected behavior of your
program.
Note:Your program must display the same information and formatted the same.
Welcome to Number Generator Program
Now generating a 4-digit random number...
The random number is : 5630
Reverse of the number is: 365
The largest digit of the number is: 6
The smallest digit of the number is: 0
The number is not a Palindrome
Thank you for using Number Generator Program!
In C + + , we can use rand ( ) function ( More

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!