Question: 4. Write a complete C++ program that does the following: - Prompts the user for a two- or three-digit integer. - If the input does

 4. Write a complete C++ program that does the following: -

4. Write a complete C++ program that does the following: - Prompts the user for a two- or three-digit integer. - If the input does not have the required amount of digits, tell the user "You are not playing nicely." and end the program. (You can use a second "return 0" before the program sign-off to end the program earlier.) - If it is a two-digit number, print the leftmost digit (i.e., tens digit) to the monitor - If it is a three-digit number, print the middle digit to the monitor

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 Databases Questions!