Question: Use the code below to answer the matching questions which follow int cntr; int total; int twoBack = 1; cntr = 0; while (cntr

Use the code below to answer the matching questions which follow

int cntr;

int total;

int twoBack = 1;

cntr = 0;

while (cntr <= 10){

twoBack = cntr - 2;

cntr++;

}

System.out.println("Loop A: " + twoBack);

cntr = 1;

while (cntr <= 4){

if (cntr % 2 == 3) cntr *= cntr;

cntr += cntr;

}

System.out.println("Loop B: " + cntr);

total = 0;

for (cntr = 5; cntr >= -5; cntr--){

total += cntr;

}

System.out.println("Loop C: " + total);

total = 0;

cntr = 10;

while(cntr<=15) {

total += cntr;

cntr += 5;

}

System.out.println("Loop D: " + total);

Indicate the output which would be produced by the above code by matching the correct answer to the question. Note: Not all answers will be used and a given answer maybe used more than once.

- A. B. C. D. E. F. G.

Loop A: ____

- A. B. C. D. E. F. G.

Loop B: ____

- A. B. C. D. E. F. G.

Loop C:____

- A. B. C. D. E. F. G.

Loop D:____

A.

9

B.

75

C.

-3

D.

24

E.

8

F.

25

G.

none of the supplied answers are correct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!