Solved

The Following for Loop Is Odd in That the Loop

Question 12

Short Answer

The following for loop is odd in that the loop increment value changes during iterations of the loop. Determine the number of times the loop iterates and the final value of j after the loop terminates.
int k = 0;
for (j = 0; j < 20; j += k)
k++;

Correct Answer:

verifed

Verified

Six times ...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions