Question: Complete the following assignment in C++. Ask the user how many integers that he/she wants to enter. Using a for loop, ask the user for
Complete the following assignment in C++.
Ask the user how many integers that he/she wants to enter. Using a for loop, ask the user for that many integers. Then, display all those integers.
Required output:
How many integers do you have? (Max 20) Enter element for subscript 0 Enter element for subscript 1 Enter element for subscript 2 Here are all of those numbers 100 200 300
_____________________________________________________________________________________________________
Modify the previous program. When the program says How many integers do you have? (Max 20), ensure that only a number between 1 and 20 is entered. If the input is outside that range, then print a message and end the program.
Required output:
How many integers do you have? (Max 20) You must enter a number in between 1 and 20
_____________________________________________________________________________________________________
Modify the previous program. Make it so the sum of the number is displayed.
Required output:
How many integers do you have? (Max 20) Enter element for subscript 0 Enter element for subscript 1 Enter element for subscript 2 Here are all of those numbers 50 60 70 The sum of these numbers is 180
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
