What is printed? (sum of even numbers algorithm with N = 9) python N = 9 s, i = 0, 2 while i <= N: s += i i += 2 print(s)
- 18
- 30
- 25
- 20
Answer
D) 20
2 + 4 + 6 + 8 = 20; the loop stops when i = 10. SLO CS-11-B-01
Computer Science MCQ · More Unit 2: Computational Thinking and Algorithms MCQs · Practise