Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include using namespace std; int main() { int number1 = 0; // The first number int number2 = 0; // The second number int counter

#include

using namespace std;

int main()

{

int number1 = 0; // The first number

int number2 = 0; // The second number

int counter = 0;

while (counter <5){ cout><<"Please enter the values of number1 and number2 "<>number1>>number2; cout<<" The sum is : "<

counter += 1;

}

cout<<"good bye"<

return 0;

}

Compile and run the above program.

1. How many times does the program above read the values of number1and number2and then compute their sum?

2. Modify the above program to run the while loop for 10 interactions.

3. Modify the above program to compute subtraction, multiplication and division.

4. Modify the above program to run the while loop for infinite number of iterations (endless loop). Using for loop or while loop: 1. Write a C++ program to compute and print the sum of all integers between 5 and 20, and then compute the average of these numbers. 2. Write a program that prints the multiples of 3 , between 1 and 999.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions

Question

1. Discuss the four components of language.

Answered: 1 week ago

Question

f. What stereotypes were reinforced in the commercials?

Answered: 1 week ago