On this page
Class 11 computer science starts with problem solving, and many students rush through it to reach Python. Then a test asks for a flowchart to check whether a number is prime, and the diagram has a decision box with one exit, or no end. This post explains what CBSE expects from algorithms, flowcharts and pseudocode, works one problem through all three forms, and shows how to check it with a dry run.
Where does this sit in the syllabus?
The CBSE Computer Science curriculum for 2026-27 opens Unit 2 of Class 11, Computational Thinking and Programming 1 (45 of 70 theory marks), with "Introduction to Problem-solving": the steps of problem solving (analysing the problem, developing an algorithm, coding, testing and debugging), representing algorithms with flowcharts and pseudocode, and decomposition. The flowchart also returns later in the same unit, beside if-else and loops.
The textbook chapter is Chapter 4, Introduction to Problem Solving, in the NCERT Class 11 Computer Science book.
What makes a good algorithm?
NCERT defines an algorithm as a finite sequence of steps that gives the desired output in a finite amount of time. It lists five characteristics: precision (each step clearly stated), uniqueness (each step's result depends only on the input and earlier steps), finiteness (it always stops), input and output. Before writing steps, identify three things: the input, the processing and the output.
Which flowchart shapes do you need?
NCERT's Table 4.1 uses five symbols:
Oval (terminator): Start and End.
Parallelogram (input/output): reading a value or printing a result.
Rectangle (process): a calculation or assignment.
Diamond (decision): a yes/no question, with two exits.
Arrow: the order of steps.
Pseudocode has no fixed standard. NCERT suggests keywords such as INPUT, COMPUTE, PRINT, INCREMENT, IF/ELSE and WHILE. It should be readable by a person, not runnable by a computer.
Worked example: is a number prime?
NCERT compares four ways of testing for a prime. We use its third method: try divisors only up to the square root of the number. Writing d × d ≤ n avoids computing a square root.
Input: a whole number n. Process: try divisors d = 2, 3, 4 and so on while d × d ≤ n. Output: "prime" or "not prime".
Pseudocode:
INPUT n
IF n < 2 THEN
PRINT "not prime"
ELSE
d = 2
isPrime = TRUE
WHILE d * d <= n AND isPrime
IF n MOD d = 0 THEN
isPrime = FALSE
INCREMENT d
IF isPrime THEN PRINT "prime" ELSE PRINT "not prime"The flowchart in words: Start (oval) → Input n (parallelogram) → "n < 2?" (diamond). Yes leads to Print "not prime". No leads to d = 2, isPrime = TRUE (rectangle) → "d × d ≤ n and isPrime?" (diamond). Yes leads to "n mod d = 0?" (diamond), whose Yes exit sets isPrime = FALSE; both exits then go to d = d + 1 and back up to the loop diamond. No from the loop diamond leads to the final decision and print, then End. Every diamond has exactly two labelled exits.
How do you check it with a dry run?
NCERT calls taking a sample input through every step a dry run. It helps you find wrong steps and missing details. Programming researchers call the same habit tracing or desk checking, and a study of students in seven countries found many first-year programmers weak at it.
Dry run for n = 91:
d = 2: 91 mod 2 = 1, continue.
d = 3: 91 mod 3 = 1, continue.
d = 4: 91 mod 4 = 3. d = 5: remainder 1. d = 6: remainder 1.
d = 7: 91 mod 7 = 0, so isPrime = FALSE. The loop stops. Output: not prime (91 = 7 × 13).
For n = 97 the loop tries d = 2 to 9 (since 10 × 10 = 100 > 97), finds no factor and prints "prime". That is 8 checks. NCERT's first method, dividing by every number from 2 to 96, needs 95, and its second method, stopping at half the number, needs 47. This is the "comparison of algorithms" idea from the chapter in numbers.
Now test the edge cases. For n = 2, 2 × 2 = 4 > 2, so the loop never runs and the output is "prime", which is correct. For n = 1, the first decision prints "not prime". If you drop that first check, 1 is wrongly reported as prime.
What do students get wrong?
Using a rectangle for input or output. Input and output take a parallelogram.
A decision diamond with one exit, or exits without Yes/No labels.
No End symbol, or a loop arrow that never reaches it.
Writing Python syntax as pseudocode, such as range() or colons. Pseudocode should describe the steps, not the language.
Skipping the dry run. NCERT's own example, adding two times in hours and minutes, gives "6 hrs 70 mins" until a dry run shows the minutes need carrying.
From pseudocode to Python
The same steps translate almost line for line into a while loop. Our guide to flow of control in Python covers the if and while statements you need, and searching and sorting in Python shows longer algorithms you can practise drawing.
If decomposition or loop conditions feel unclear, the Fermi Concept Library covers every concept in physics, chemistry, biology, mathematics and computing, so you can read the idea before drawing it again.
A practice routine
Pick one problem a day from NCERT's exercises: largest of three numbers, sum of a series, factorial.
Write the input, process and output first, then pseudocode, then the flowchart.
Dry run with three inputs, including one edge case, and only then write the Python.
Start with the prime test above: draw the flowchart from memory and dry run it for 49.



