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. In C++ please! WARNING: you MUST use while loop to complete this

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

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!