Inside the ncert book class 11 computer science chapter 6 flow of control file on this page you will find every if, elif and nested if pattern, the full for and while loop syntax, and all 19 sample programs with their printed output. This is the official NCERT chapter for 2026-27, hosted with no pages removed.
- Chapter: Chapter 6, Flow of Control
- Book: Computer Science, the Class 11 NCERT textbook for 2026-27, 11 chapters
- File: 22 pages, printed pages 121 to 142, the complete official chapter
You can page through all five loop flowcharts, the range() examples and every one of the 19 programs in the viewer above before downloading.
This is the official NCERT chapter file for the 2026-27 session, hosted by Collegedunia with no pages removed.
How the Flow of Control Chapter Is Laid Out
The chapter opens with a photograph of a school bus that has only one road to follow. That is sequence, where Python runs one statement after another from the first line to the last. Everything after that page teaches you how to break the single road into branches and loops.
The order in which statements run is called the flow of control, and Python changes it with two kinds of control structures: selection and repetition. Six numbered sections cover both.
| Section | What it covers |
|---|---|
| 6.1 Introduction | sequence, the meaning of flow of control, the two control structures |
| 6.2 Selection | if, if..else, if..elif..else and nested if, with a decision flowchart |
| 6.3 Indentation | leading whitespace as the way Python marks a block |
| 6.4 Repetition | why loops exist, the for loop, the range() function, the while loop |
| 6.5 Break and Continue | leaving a loop early and skipping one pass of it |
| 6.6 Nested Loops | a loop inside another loop, patterns and prime numbers |
| Summary and Exercise | a nine point recap, five exercise questions, 10 programming exercises |
What the Flow of Control Chapter PDF Contains
The PDF holds the whole chapter exactly as NCERT printed it. Nothing has been trimmed from the front matter, the programs or the back exercises.
- All six sections, from the meaning of sequence to nested loops
- Programs 6-1 to 6-19, each with the code and the printed output below it
- Examples 6.1 to 6.4, including the four range() calls typed at the shell prompt
- Seven figures, five of them flowcharts for decisions, for loops, while loops, break and continue
- The nine point Summary, five exercise questions, 10 programming exercises and the Case Study question on the Student Management Information System
Flow of Control Explained in Simple Language
Source: Magnet Brains on YouTube
Selection with if, if-else, if-elif-else and Nested if
Section 6.2 starts with a shop that sells many pens at the same price. You have to pick one. That choice is what an if..else statement does in code. The chapter builds the four selection forms one at a time, and each one adds a single new idea.
- Plain if: the indented block runs only when the condition is true. Example 6.1 prints "Eligible to vote" when age is 18 or more
- if..else: two paths, and exactly one of them runs. Program 6-2 uses it to always print a positive difference of two numbers
- if..elif..else: a chain of conditions checked in order. The moment one is true, its block runs and the whole statement ends
- Nested if: an if..else placed inside an elif block, as in the four function calculator of Program 6-3
Example 6.2 checks whether a number is positive, negative or zero. Example 6.3 prints STOP, Be Slow or Go for a red, orange or green signal. The number of elif branches you write depends only on how many conditions you need to test, and the final else is optional.
Program 6-3 is the one to study closely. It reads two values and an operator, then handles a subtraction that must stay positive and a division where the second value is zero. Both cases need an if..else sitting inside an elif, which is the chapter's definition of nesting.
Indentation, the Whitespace Rule Python Treats as Syntax
Section 6.3 opens with a line from Guido van Rossum saying that making indentation part of the syntax guarantees that all code is properly indented. Most languages use curly brackets to mark a block. Python uses the spaces at the start of a line instead.
- Indentation is the leading whitespace, spaces or tabs, before a statement
- Statements at the same level of indentation form one block of code
- The interpreter checks the levels strictly and raises a syntax error when they do not match
- Common practice is a single tab, or four spaces, for each level
- The same rule marks nested blocks, so an if inside a while is indented twice
Program 6-4 shows it working. Two numbers are compared, and each branch of the if..else holds two print statements indented by the same amount. Because num2 is larger, Block2 runs and the output is "second number is larger" followed by "Bye Bye". Move one of those print statements left by a single space and the program stops running, which is why the chapter gives indentation a section of its own.
Repetition with the for Loop and the range() Function
Section 6.4 asks a simple question. Program 6-5 prints the first five natural numbers with five print statements, so what would you do for the first 100,000? Writing 100,000 lines is not an answer. A loop is.
The for statement runs its body once for every item in a range or a sequence. You use it when the number of passes is known in advance. Program 6-6 prints the letters of 'PYTHON' one below the other, Program 6-7 walks a list of five numbers, and Program 6-8 prints only the even ones by putting an if inside the loop.
The range() function supplies the numbers. Its syntax is range([start], stop[, step]), and it produces integers from start up to but not including stop.
| Call | What it gives | Rule it shows |
|---|---|---|
| list(range(10)) | 0 to 9 | start defaults to 0, step defaults to 1 |
| list(range(2, 10)) | 2 to 9 | stop is excluded |
| list(range(0, 30, 5)) | 0, 5, 10, 15, 20, 25 | step sets the gap |
| list(range(0, -9, -1)) | 0 down to -8 | a negative step counts backwards |
All three parameters must be integers, and step can never be zero. Program 6-9 combines range() with an if to print the multiples of 10 for numbers in a given range.
The while Loop, Infinite Loops and for Compared with while
Section 6.4.2 covers the second looping construct. A while loop tests its condition before it runs the body, and keeps going for as long as the condition stays true. If the condition is false at the very start, the body never runs even once.
Program 6-10 prints the first five natural numbers by setting count to 1 and adding 1 on every pass. Program 6-11 finds the factors of a number by testing every value up to half of it, and uses the end parameter of print() to keep the answers on one line.
| Point of difference | for loop | while loop |
|---|---|---|
| What it runs over | a range or a sequence | a condition that stays true |
| Number of passes | known before the loop starts | not known in advance |
| Counter handling | range() moves it for you | you set it and change it yourself |
| If nothing matches | an empty range means no pass | a false condition means no pass |
| Risk to watch | an off by one stop value | an infinite loop |
The chapter warns about that last risk twice. The statements inside a while must eventually make the condition false. A condition that never turns false gives an infinite loop, which the chapter calls a logical error. Exercise question 4 asks you to define an infinite loop and give one example, so this line is worth learning.
One point often asked in class: Python does allow an else block attached to a loop, but this chapter does not use it. Every else you see in Chapter 6 belongs to an if.
break, continue and Nested Loops in the Flow of Control Chapter
Section 6.5 gives you two ways to change a loop from inside it. Both are small statements with very different effects, and exercise question 3 asks you to tell them apart with examples.
- break: ends the loop at once and moves to the statement after it. Program 6-12 stops a for loop when num reaches 8, so only values 1 to 7 print
- continue: skips the rest of the body for that pass and jumps back to the loop start. Program 6-15 prints 1, 2, 4, 5, 6 and leaves out 3
- while True with break: Program 6-13 adds numbers until a negative one is typed, which is the standard way to end a loop on user input
- break inside a check: Program 6-14 leaves the prime test as soon as one factor is found, because no further checking is needed
Section 6.6 closes the chapter with nested loops, a loop written inside another loop. Program 6-16 shows the order clearly: the inner loop finishes completely on every single pass of the outer one. Python sets no limit on how deep the nesting can go, and a for may sit inside a while or the other way round.
Program 6-17 prints the number triangle 1, then 1 2, then 1 2 3, and Program 6-18 finds every prime between 2 and 50 with a while nested inside a for. Programming exercise 9 then asks for four more patterns, including a star diamond, which is where most of the practice time in this chapter goes.
What Collegedunia Adds to This Chapter PDF
Collegedunia gives students the file plus a way into it. The chapter PDF is the official NCERT file, untouched.
- Official file: the exact NCERT chapter PDF, no pages removed
- Read in the browser: page through all 22 pages first
- Chapter list: jump to any other chapter from one table
Also Check: the other Class 11 Computer Science resources for this chapter.
| Resource | Link |
|---|---|
| Handwritten notes | Flow of Control Class 11 Handwritten Notes |
| Chapter notes | Flow of Control Class 11 Notes (coming soon) |
| Chapter solutions | Flow of Control Class 11 NCERT Solutions (coming soon) |
| Previous chapter book PDF | Getting Started with Python Class 11 NCERT Book PDF |
| Next chapter handwritten notes | Functions Class 11 Handwritten Notes |
Class 11 Computer Science NCERT Book PDF: All Chapters
Every chapter of the book is on its own page. The 2026-27 Class 11 Computer Science textbook has 11 chapters, and chapters 5 to 10 form the Python programming block.
| Chapter | Download |
|---|---|
| Chapter 1 | Computer System NCERT Book PDF |
| Chapter 2 | Encoding Schemes and Number System NCERT Book PDF |
| Chapter 3 | Emerging Trends NCERT Book PDF |
| Chapter 4 | Introduction to Problem Solving NCERT Book PDF |
| Chapter 5 | Getting Started with Python NCERT Book PDF |
| Chapter 6 | Flow of Control NCERT Book PDF |
| Chapter 7 | Functions NCERT Book PDF (coming soon) |
| Chapter 8 | Strings NCERT Book PDF (coming soon) |
| Chapter 9 | Lists NCERT Book PDF (coming soon) |
| Chapter 10 | Tuples and Dictionaries NCERT Book PDF (coming soon) |
| Chapter 11 | Societal Impact NCERT Book PDF (coming soon) |
Flow of Control Class 11 NCERT Book PDF FAQs
Common Student Questions on the Flow of Control Chapter File
Ques. Where can I download the Class 11 Computer Science Chapter 6 NCERT Book PDF?
Ans. The official 22-page chapter file is on this page, free to download.
Ques. How many pages is the Flow of Control chapter?
Ans. 22 pages, printed pages 121 to 142 in the 2026-27 book, and this PDF is the complete chapter.
Ques. What is flow of control in Python?
Ans. It is the order in which the statements of a program run. Python changes that order with two control structures, selection and repetition.
Ques. What is the difference between else and elif?
Ans. An elif tests one more condition before its block runs. An else has no condition and runs only when every condition above it is false. A statement can have many elif branches but only one else.
Ques. What is the purpose of the range() function?
Ans. It builds a sequence of integers from start up to but not including stop, moving by step. For example range(0, 30, 5) gives 0, 5, 10, 15, 20 and 25.
Ques. How is break different from continue?
Ans. break ends the loop straight away and moves to the statement after it. continue only skips the rest of the current pass and goes back to the top of the loop for the next one.
Ques. What is an infinite loop?
Ans. A loop whose condition never becomes false, so it never stops. It happens when the body forgets to change the control variable, and the chapter treats it as a logical error.
Ques. Why does Python use indentation instead of curly brackets?
Ans. The leading spaces or tabs mark a block. Statements indented by the same amount belong to the same block, and the interpreter raises a syntax error if the levels do not match.
Ques. Is this the official NCERT file?
Ans. Yes. It is the NCERT chapter PDF for 2026-27 hosted as published, with no pages removed or added.







Comments