Quiz: Loops

In this lesson, your understanding of the loop will be tested.

1
var values = 10;
var i = 0;
while ( i < values ) {
    i += 1;
    values = values - 1;
  }

Consider the above code snippet and select the option when while loop gets terminated?

A)

when i becomes 5

B)

when values becomes 5

C)

when both i and values become 5

Question 1 of 50 attempted

Get hands-on with 1400+ tech skills courses.