- 5
What is sum after the following loop terminates?
int sum = 0; int item = 0; do {item ++; if (sum> = 4) continue; sum + = it
1 Respuesta
+ 1
Your code is cut off so it isn't possible to confidently answer your question.
Variable "it" is undefined so you probably meant "item". That assumption is not enough though.
You don't have the end of the do-while loop. If the ending was } while(false); that would behave completely different from } while (true); and it is a waste of time to branch into all the possible what-ifs to answer your question.