Pretest loop

What is the difference between a pretest loop and a posttest loop? (2, 4, 5)

How many times will each of the following loops execute? What is the output in each case?  (5)

a. x = 5;  y = 50;

 do

    x = x + 10;

 while (x <>

 cout < x=””>< “=”” “=””>< y=””>< endl;=””>

b. x = 5;

  y = 80;

 do

    x = x * 2;

 while (x <>

 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 <>

    x = x + 10;

 cout < x=””>< “=”” “=””>< y=””>< endl;=””>

e. x = 5;

  y = 30;

 while (x <=>

    x = x * 2;

 cout < x=””>< “=”” “=””>< y=””>< endl;=””>

f. x = 5;

  y = 30;

 while (x > y)

    x = x + 2;

 cout < x=””>< “=”” “=””>< y=””><>

WhatsApp
Hello! Need help with your assignments?

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

🛡️ Worried About Plagiarism? Run a Free Turnitin Check Today!
Get peace of mind with a 100% AI-Free Report and expert editing assistance.

X