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: - 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
Get step-by-step solutions from verified subject matter experts
