CBSE Class 11 Computer Science Question 60 of 161

Flow of Control — Question 42

Back to all questions
42
Question

Question 42

What is the output produced when this code executes?

a = 0
for i in range(4,8):
    if i % 2 == 0:
        a = a + i
print (a) 
  1. 4
  2. 8
  3. 10 ✓
  4. 18
Answer