Question: Write a C++ program that asks for five negative integers. Find and display the second smallest value. If the user enters a non-negative number, the

 Write a C++ program that asks for five negative integers. Find

Write a C++ program that asks for five negative integers. Find and display the second smallest value. If the user enters a non-negative number, the program has to ask the user to input again, until the input is correct. No sorting algorithm is allowed. You must follow the input and output formats as shown in the sample below: Please enter a negative number: -23 Please enter a negative number: -2 Please enter a negative number: 12 Wrong input. Please enter again: 55 Wrong input. Please enter again: -99 Please enter a negative number: 67 Wrong input. Please enter again: -45 Please enter a negative number: -38 The second smallest number is -45

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!