How many times will each of the following loops execute? What is the output in each case?
a. x = 5; y = 50;
do
x = x + 10;
while (x < y);
cout << x << " " << y << endl;
b. x = 5; y = 80;
do
x = x * 2;
while (x < y);
cout << x << " " << y << endl;
c. x = 5; y = 20;
do
x = x + 2;
while (x >= y);
cout << x << " " << y << endl;
d. x = 5; y = 35;
while (x < y)
x = x + 10;
cout << x << " " << y << endl;
e. x = 5; y = 30;
while (x <= y)
x = x * 2;
cout << x << " " << y << endl;
f. x = 5; y = 30;
while (x > y)
x = x + 2;
cout << x << " " << y << endl;