Question: In C++ please! WARNING: you MUST use while loop to complete this exercise in order to receive points! Write a program that takes some positive
In C++ please!
WARNING: you MUST use while loop to complete this exercise in order to receive points!
Write a program that takes some positive integers as input until a zero or a negative number is entered. The program then computes and outputs the sum of all the even integers (excluding 0). If the first number the user enters is 0 or a negative number, the program will output No valid integers entered. and exit.
Ex: if the input is:
1 2 3 4 5 6 7 8 9 10 -1
then the program will output:
The sum of all even numbers is: 30
If the input is:
0
then the program will output the following and exit
No valid integers entered.
WARNING: you MUST use while loop to complete this exercise in order to receive points! Write a program that takes some positive integers as input until a zero or a negative number is entered. The program then computes and outputs the sum of all the even integers (excluding 0). If the first number the user enters is 0 or a negative number, the program will output No valid integers entered. and exit. Ex: if the input is: 1 2 3 4 5 6 7 8 9 10 -1 then the program will output: The sum of all even numbers is: 30 If the input is: 0 then the program will output the following and exit No valid integers entered
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts

