Which of the following for-loop headers results in equivalent numbers of iterations:

A. for (int q = 1; q <= 100; q++)
B. for (int q = 100; q >= 0; q--)
C. for (int q = 99; q > 0; q -= 9)
D. for (int q = 990; q > 0; q -= 90)

a. A and B.
b. C and D.
c. A and B have equivalent iterations and C and D have equivalent iterations.
d. None of the loops have equivalent iterations.

b. C and D.

Computer Science & Information Technology

You might also like to view...

The NPER is the total number of payment periods

Indicate whether the statement is true or false

Computer Science & Information Technology

Critical Thinking QuestionsCase 9-2Another colleague shares the following code with you:Dim strEmployees(50) As String' Later in the codeReDim strEmployees(65).Which of the following is NOT true based on what you see in your colleague's code? a. The strEmployees array originally is sized to hold 51 values.c. If the array had been redimensioned to a smaller size, your colleague would not lose the items between the original upper-bound array size and the new smaller upper-bound array size.b. The strEmployees array is reinitialized to hold 66 values.d. When the array is redimensioned, all the data contained in the array is lost.

What will be an ideal response?

Computer Science & Information Technology