Output of a while loop
The while loop in Listing 1 prints num and then increases it by 2.
num while it is less than 10.
Which sequence does the loop print?
- 7, 9
- 5, 6, 7, 8, 9
- 5, 6, 7, 8, 9, 10
- 5, 7, 9
The while loop in Listing 1 prints num and then increases it by 2.
num while it is less than 10.
Which sequence does the loop print?