Question: Write a complete C++ program that uses a counted while loop to calculate the sum of the even integers between 1 and n. Assume
Write a complete C++ program that uses a counted while loop to calculate the sum of the even integers between 1 and n. Assume n is positive. Algorithm: DECLARATION OF VARIABLES cout < < "Enter n: "; INPUT n INITIALIZATION OF VARIABLES WHILE count IS LESS THAN OR EQUAL TO n { check if count is even ADD count TO sum STORING RESULT IN sum INCREMENT count } "1 cout < < "The sum of the even integers is: < < sum < < endl < < < endl;
Step by Step Solution
There are 3 Steps involved in it
C include int main DECLARATI... View full answer
Get step-by-step solutions from verified subject matter experts
