Question: 4. (8 points) Write a small main program that reads integers from standard input and keeps track of the second smallest integer, outputting that value

4. (8 points) Write a small main program that reads integers from standard input and keeps track of the second smallest integer, outputting that value at the end. (Use the typical while (cin >> n) loop.) Example: if the numbers 5,2,9,3,4 are fed into the program, 3 would be the output. You can assume that standard input has at least 2 integers. You can also assume all the standard #include's are there. Just write main). Do NOT use a sort function. You should be able to do this without sorting the entire input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
