What is wrong with the following while repetition structure (assume z has value 100) While ( z >= 0 )
sum += z;
Answers
Answered by
2
Answer:
ANS: x = x + 1;
x += 1;
++x;
x++;
Answered by
1
Answer:
A single execution of the loop body is called an iteration. The loop in the example above makes three iterations.
If i++ was missing from the example above, the loop would repeat (in theory) forever. In practice, the browser provides ways to stop such loops, and in server-side JavaScript, we can kill the process.
Any expression or variable can be a loop condition, not just comparisons: the condition is evaluated and converted to a boolean by while.
Similar questions
Math,
1 month ago
Math,
1 month ago
Social Sciences,
4 months ago
Math,
4 months ago
English,
10 months ago
Social Sciences,
10 months ago
Physics,
10 months ago