CBSE Class 11 Computer Science Question 61 of 161

Flow of Control — Question 43

Back to all questions
43
Question

Question 43

Which of the following code segments contain an example of a nested loop?

  1. for i in range(10):
        print(i)
    for j in range(10):
        print(j)
  2. for i in range(10):
        print(i)
        for j in range(10):
            print(j) ✓
  3. for i in range(10):
        print(i)
        while i < 20:
            print(i)
            i = i + 1 ✓
  4. for i in range(10):
        print(i)
    while i < 20:
        print(i)
Answer