Question: In C++, Largest and smallest Write a program that will accept n number of integers from the keyboard. When the loop exits output the largest
In C++,

Largest and smallest Write a program that will accept n number of integers from the keyboard. When the loop exits output the largest and smallest value entered. Note: Be careful, it is not appropriate to initialize the variables that hold the largest and smallest values to 0 as your first number. If you think about it if all values entered are greater than O then your program will output O as the smallest number and this was not a number that was entered. Required: The only decisions staments allowed inside the loop are to determine the largest and smallest value. This means you are not allowed to use a decision to determine if the first number was entered. This is going to require you to prime your loop. We cover priming the loop in the next section but for this assignment it means get the first number before the loop begins. We will also assume that at least one number is going to be input. The following is an example of how your program should run C:WINDOWS system32\cmd.exe ow many numbers do you want to enter Enter a number Enter a number nter a number nter a number nter a number 5 he largest number was 55 The smallest number was 1 Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
