Flow of Control
CBSE · Class 11 · Computer Science
NCERT Solutions for Flow of Control — CBSE Class 11 Computer Science.
Interactive on Super Tutor
Studying Flow of Control? Get the full interactive chapter.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan — built for ncert solutions and more.
1,000+ Class 11 students started this chapter today
11 worked solutions below. Unlock all 21 free in Super Tutor
EXERCISE
1What is the difference between else and elif construct of if statement?Show solution
So:
- elif = “else if”, used for multiple conditions
- else = executes when all conditions are false
Not sure why a step works? check your working in Super Tutor
2What is the purpose of range() function? Give one example.Show solution
Example: `list(range(2, 10))` gives `[2, 3, 4, 5, 6, 7, 8, 9]`.
Not sure why a step works? check your working in Super Tutor
3Differentiate between break and continue statements using examples.Show solution
- break: immediately ends the loop and control moves to the statement after the loop.
- continue: skips the remaining statements of the current iteration and goes back to the beginning of the loop for the next iteration.
Example of break:
```python
for i in range(1, 6):
if i == 3:
break
print(i)
```
Output:
`1 2`
Example of continue:
```python
for i in range(1, 6):
if i == 3:
continue
print(i)
```
Output:
`1 2 4 5`
Not sure why a step works? check your working in Super Tutor
4What is an infinite loop? Give one example.Show solution
Example:
```python
while True:
print("Hello")
```
This loop never stops unless it is broken by a `break` statement or the program is terminated.
Not sure why a step works? check your working in Super Tutor
5(i)a = 110
while a > 100:
print(a)
a -= 2Show solution
Step by step:
- `110 > 100` → print `110`, then `a = 110 - 2 = 108`
- `108 > 100` → print `108`, then `a = 106`
- `106 > 100` → print `106`, then `a = 104`
- `104 > 100` → print `104`, then `a = 102`
- `102 > 100` → print `102`, then `a = 100`
- `100 > 100` is false, so the loop stops
So the output is the numbers from `110` down to `102`, decreasing by `2`.
Not sure why a step works? check your working in Super Tutor
5(ii)for i in range(20,30,2):
print(i)Show solution
So the values are:
- `20`
- `22`
- `24`
- `26`
- `28`
Not sure why a step works? check your working in Super Tutor
5(iii)country = 'INDIA'
for i in country:
print (i)Show solution
- `I`
- `N`
- `D`
- `I`
- `A`
Not sure why a step works? check your working in Super Tutor
5(iv)i = 0; sum = 0
while i < 9:
if i % 4 == 0:
sum = sum + i
i = i + 2
print (sum)Show solution
The loop runs while `i < 9`, and `i` increases by `2` each time.
Values of `i`: `0, 2, 4, 6, 8`
Check when `i % 4 == 0`:
- `i = 0` → yes, `sum = 0 + 0 = 0`
- `i = 2` → no
- `i = 4` → yes, `sum = 0 + 4 = 4`
- `i = 6` → no
- `i = 8` → yes, `sum = 4 + 8 = 12`
So the final printed value is `12`.
Not sure why a step works? check your working in Super Tutor
5(v)for x in range(1,4):
for y in range(2,5):
if x * y > 10:
break
print (x * y)Show solution
The statement `print(x * y)` is after `break`, so it is never executed.
Check the condition `x * y > 10`:
- For `x = 1`: products are `2, 3, 4` → no break
- For `x = 2`: products are `4, 6, 8` → no break
- For `x = 3`: products are `6, 9, 12` → when `y = 4`, condition becomes true and the inner loop breaks
Since the print is unreachable, nothing is printed.
Not sure why a step works? check your working in Super Tutor
5(vi)var = 7
while var > 0:
print ('Current variable value: ', var)
var = var -1
if var == 3:
break
else:
if var == 6:
var = var -1
continue
print ("Good bye!")Show solution
Loop steps:
1. Print `Current variable value: 7`
2. `var = var - 1` → `var = 6`
3. `if var == 3` → false
4. `else` branch: `if var == 6` → true, so `var = var - 1` makes `var = 5`, then `continue`
- `Good bye!` is skipped
Next iteration:
1. Print `Current variable value: 5`
2. `var = 4`
3. `if var == 3` → false
4. `if var == 6` → false
5. Print `Good bye!`
Next iteration:
1. Print `Current variable value: 4`
2. `var = 3`
3. `if var == 3` → true, so `break`
So the output is:
- `Current variable value: 7`
- `Current variable value: 5`
- `Good bye!`
- `Current variable value: 4`
Not sure why a step works? check your working in Super Tutor
PROGRAMMING EXERCISES
1Write a program that takes the name and age of the user as input and displays a message whether the user is eligible to apply for a driving license or not. (the eligible age is 18 years).Show solution
name = input("Enter your name: ")
age = int(input("Enter your age: "))
if age >= 18:
print(name, "is eligible to apply for a driving license")
else:
print(name, "is not eligible to apply for a driving license")
```
Not sure why a step works? check your working in Super Tutor
CASE STUDY-BASED QUESTIONS
10 more solved questions in Flow of Control
Every remaining exercise is solved step by step in Super Tutor, plus practice quizzes and flashcards for this chapter. Free to start.
Stuck on a step?
Ask Super Tutor AI to explain any solution on this page in a simpler way — free, 24x7.
Ask a Doubt FreeFrequently Asked Questions
What are the important topics in Flow of Control for CBSE Class 11 Computer Science?
How to score full marks in Flow of Control — CBSE Class 11 Computer Science?
Where can I get free NCERT Solutions for Flow of Control Class 11 Computer Science?
Sources & Official References
- NCERT Official — ncert.nic.in
- CBSE Academic — cbseacademic.nic.in
- CBSE Official — cbse.gov.in
- National Education Policy 2020 — education.gov.in
Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.
More resources for Flow of Control
Practice Quiz
Test yourself with a quick quiz
Important Questions
Practice with board exam-style questions
Revision Notes
Key points for last-minute revision
Formula Sheet
All formulas in one place
Chapter Summary
Understand the chapter at a glance
Concept Maps
See how topics connect visually
Study Plan
Step-by-step plan to ace this chapter
Flashcards
Quick-fire cards for active recall
Syllabus
What topics to cover
For serious students
Get the full Flow of Control chapter — for free.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan for CBSE Class 11 Computer Science.