Answer to Question #285540 in C++ for Jeanelle

Question #285540

1.      Using the looping statement. Create a program that will display the following:

 

 

 

A.    5

10

15

20

25

30

 

 

B.     100 90 80 70 60 50 40 30 20 10

 

 

1
Expert's answer
2022-01-07T13:49:39-0500
#include<iostream>

using namespace std;

int main()
{
	cout << "Variant A:\n";
	for (int i = 5; i <= 30; i += 5)
	{
		cout << i<<endl;
	}
	cout << "Variant B:\n";
	for (int i = 100; i >= 10; i -= 10)
	{
		cout << i << endl;
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment