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
#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;
}
}
Comments
Leave a comment