Skip to content
Computer ScienceCBSE Class 11 · Introduction to Problem Solving

Algorithms, Flowcharts and Pseudocode Class 11: Writing and Reading Solutions

Updated 17 October 2026 · Fact-checked

An algorithm is a finite, ordered set of unambiguous steps that solves a problem and ends with the required output. A flowchart shows an algorithm with standard symbols (oval start and end, parallelogram input and output, rectangle process, diamond decision) joined by arrows; pseudocode describes it in structured English using keywords such as INPUT, IF, THEN, ELSE, WHILE and PRINT. Algorithms are built using sequence, selection and repetition; a simple one may use only some of them.

Follow the arrows: the diamond asks one question, and only one branch (Yes or No) runs before both paths meet at End.

Illustration drawn for QuestionBuddy.

Understand Algorithms, Flowcharts and Pseudocode for Problem Solving

Characteristics of an algorithm. Precise (each step clear), unambiguous, finite (ends after a limited number of steps), has well-defined inputs and outputs, and uses only operations that can be carried out.

Flowchart symbols. Oval: start and end (terminator). Parallelogram: input and output. Rectangle: processing or calculation. Diamond: decision (yes/no or true/false branches). Arrows: direction of flow. Circle: connector (joins parts of a flowchart).

Pseudocode. Written in plain structured statements without the strict syntax of a language. Typical keywords: INPUT, READ, PRINT, DISPLAY, SET, IF-THEN-ELSE-ENDIF, WHILE-DO-ENDWHILE, FOR-TO-DO-ENDFOR.

Three control structures.

  • *Sequence*: steps executed one after another.
  • *Selection*: a decision selects one of the paths (IF).
  • *Repetition*: a block repeats while a condition holds (WHILE or FOR).

Example (largest of two numbers).

INPUT a, b
IF a > b THEN
    PRINT a
ELSE
    PRINT b
ENDIF

The flowchart has an oval start, a parallelogram to input a and b, a diamond testing a > b, two parallelograms to print, and an oval end.

Example (sum of first N natural numbers).

INPUT N
SET sum = 0
SET i = 1
WHILE i <= N DO
    sum = sum + i
    i = i + 1
ENDWHILE
PRINT sum

For N = 4 the loop adds 1, 2, 3, 4 and prints 10.

Steps of problem solving. Analyse the problem, develop an algorithm, code, test and debug. The principle "garbage in, garbage out (GIGO)" reminds us that wrong input gives wrong output even when the algorithm is right.

Algorithms, Flowcharts and Pseudocode for Problem Solving: key facts

Algorithm
  • Finite
  • Precise
  • Unambiguous
  • Defined inputs
  • Defined outputs
Five characteristics.
Flowchart symbols
Ovalstart or end
Parallelograminput or output
Rectangleprocess
Diamonddecision
Arrowflow
Standard shapes.
Control structures
  • Sequence
  • Selection
  • Repetition
Every algorithm is built from these, in any combination.
Pseudocode keywords
  • INPUT
  • PRINT
  • IF THEN ELSE ENDIF
  • WHILE DO ENDWHILE
  • FOR TO DO ENDFOR
Structured English.

How to answer Algorithms, Flowcharts and Pseudocode for Problem Solving questions

Write an algorithm by listing inputs, processing and outputs, then choose the control structure.

  1. 1State the inputs and the required output.
  2. 2List the steps in order (sequence).
  3. 3Mark any decision and write both branches (selection).
  4. 4Mark any repeated steps and the stopping condition (repetition).
  5. 5Test the algorithm with a small input and an edge case.

Algorithms, Flowcharts and Pseudocode for Problem Solving in real life

The idea, met in an everyday situation. Answer the question in your own words, then compare with the model answer. The one-line hook is what to remember.

Making tea

Suppose a recipe says: boil water; add tea leaves; if you want milk then add milk; wait three minutes; pour.

Which control structures appear?

Try it first, then show the solutionSolution
  1. Boil, add leaves, wait, pour are in sequence.
  2. "If you want milk" is a selection.

Answer: Sequence and selection.

Memory hook: Steps in order, with one decision.

Tricks to remember Algorithms, Flowcharts and Pseudocode for Problem Solving

Short memory aids. Say each one aloud once, then use it on a question the same day.

  • Oval, Parallelogram, Rectangle, Diamond

    Terminator, I/O, process, decision.

    Use it when: Flowchart symbols.

  • S-S-R

    Sequence, Selection, Repetition.

    Use it when: Control structures.

Algorithms, Flowcharts and Pseudocode for Problem Solving: solved examples

Ordered from board level to HOTS. Try each one before you open the solution.

Example 1: Symbol · 1 mark · MCQBoard level

The symbol used for a decision in a flowchart is a:
(a) rectangle
(b) oval
(c) diamond
(d) parallelogram

Try it first, then show the solutionSolution
  1. A decision has two outputs, yes and no.

Answer: (c) diamond

Example 2: Characteristics · 2 marks · Short answerBoard level

State any four characteristics of a good algorithm. (2 marks)

Try it first, then show the solutionSolution
  1. It is finite: it ends after a limited number of steps.
  2. It is unambiguous and precise: each step has one clear meaning.
  3. It has defined inputs and outputs.
  4. Every step can be carried out.

Answer: Finite, precise, unambiguous, defined input and output.

Example 3: Pseudocode · 4 marks · Short answerHarder board level

Write pseudocode for finding the sum of the first N natural numbers and show its working for N = 4. (4 marks)

Try it first, then show the solutionSolution
  1. INPUT N; SET sum = 0; SET i = 1; WHILE i <= N DO sum = sum + i; i = i + 1; ENDWHILE; PRINT sum.
  2. N = 4: i = 1 gives sum = 1; i = 2 gives 3; i = 3 gives 6; i = 4 gives 10; i = 5 stops.
  3. PRINT 10.

Answer: Pseudocode as shown; output 10.

Example 4: Selection · 3 marks · Short answerHarder board level

Write an algorithm in pseudocode to input a number and print whether it is even or odd; identify the control structure and the flowchart symbol used for the test. (3 marks)

Try it first, then show the solutionSolution
  1. INPUT n; IF n MOD 2 = 0 THEN PRINT "Even" ELSE PRINT "Odd" ENDIF.
  2. The structure is selection.
  3. The test n MOD 2 = 0 is drawn as a diamond with Yes and No branches.

Answer: Selection; diamond for the test.

Example 5: Repetition with a condition · 5 marks · Short answerHOTS / competency

Write an algorithm that reads numbers until 0 is entered and prints their sum (0 is not included). Show the working for the input 5, 3, 8, 0. (5 marks)

Try it first, then show the solutionSolution
  1. SET sum = 0; INPUT x; WHILE x != 0 DO sum = sum + x; INPUT x; ENDWHILE; PRINT sum.
  2. Input 5: sum = 5. Input 3: sum = 8. Input 8: sum = 16. Input 0: loop ends.
  3. PRINT 16.
  4. Reading x before the loop and again at the end of each pass makes the first and the last test correct.

Answer: Sum 16; read before the loop and at the end of each pass.

Where students lose marks in Algorithms, Flowcharts and Pseudocode for Problem Solving

The slips examiners see most often, and what to write instead.

  • Mistake: Using a rectangle for a decision

    Mixing the symbols.

    Wrong working

    Rectangle with yes/no branches.

    Right working

    Diamond with Yes and No branches.

    Do this: Diamond is for decisions.

    Usually costs: 1 mark

  • Mistake: No stopping condition

    A loop that never ends.

    Wrong working

    WHILE i <= N DO sum = sum + i ENDWHILE

    Right working

    Add i = i + 1 inside the loop.

    Do this: Every loop must change the tested variable.

    Usually costs: 1 mark

  • Mistake: Not stating inputs and outputs

    Jumping to steps.

    Wrong working

    Step 1: add numbers.

    Right working

    INPUT a, b ... PRINT result.

    Do this: State input and output first.

    Usually costs: 1 mark

Exam tips

  • Start every algorithm with INPUT and end with PRINT.
  • Label the Yes and No branches of every diamond.
  • Name the control structure used.
  • Run a small input through the algorithm to show it works.

Practice questions on Algorithms, Flowcharts and Pseudocode for Problem Solving

Write each answer on paper first. Open the hint only if you are stuck, and the answer only when you have finished.

  1. Q1 · 1 mark · MCQBoard level

    Which of the following is NOT a characteristic of an algorithm?
    (a) finiteness
    (b) ambiguity
    (c) defined input
    (d) defined output

    Hint

    Steps must be clear.

    Answer

    (b) ambiguity

  2. Q2 · 4 marks · Short answerHarder board level

    Write pseudocode to find the largest of three numbers. Show the result for 14, 37, 25. (4 marks)

    Hint

    Compare in pairs.

    Answer

    INPUT a, b, c; SET big = a; IF b > big THEN big = b ENDIF; IF c > big THEN big = c ENDIF; PRINT big. For 14, 37, 25: big = 14; 37 > 14 so big = 37; 25 > 37 is false; PRINT 37.

  3. Q3 · 3 marks · Short answerHarder board level

    Write pseudocode to print the first 5 multiples of a number n. Give the output for n = 3. (3 marks)

    Hint

    FOR loop.

    Answer

    INPUT n; FOR i = 1 TO 5 DO PRINT n x i ENDFOR. For n = 3 it prints 3, 6, 9, 12, 15.

  4. Q4 · 1 mark · Assertion-reasonHarder board level

    Assertion (A): An algorithm must terminate after a finite number of steps.
    Reason (R): An algorithm that never ends cannot give the required output.
    (a) Both A and R are true, and R is the correct explanation of A.
    (b) Both A and R are true, but R is not the correct explanation of A.
    (c) A is true, but R is false.
    (d) A is false, but R is true.

    Hint

    Finiteness.

    Answer

    (a) Both A and R are true, and R is the correct explanation of A.

  5. Q5 · 5 marks · Short answerHOTS / competency

    A school fee is ₹5,000 for classes below 6, ₹7,000 for classes 6 to 8 and ₹9,000 above 8. Write the pseudocode to input a class and print the fee, name the control structure and give the fee for classes 3, 8 and 11. (5 marks)

    Hint

    Nested selection.

    Answer

    INPUT c; IF c < 6 THEN fee = 5000 ELSE IF c <= 8 THEN fee = 7000 ELSE fee = 9000 ENDIF ENDIF; PRINT fee. Control structure: selection (nested). Class 3 gives 5000; class 8 gives 7000; class 11 gives 9000.

Test your recall

Answer in your head or on paper first, then open the card. Pulling an answer out of memory makes it stick far better than re-reading.

  1. 1.Symbol for input and output?Show answer

    Parallelogram.

  2. 2.Symbol for start and end?Show answer

    Oval.

  3. 3.Which structure repeats steps?Show answer

    Repetition (loop).

  4. 4.What does GIGO stand for?Show answer

    Garbage in, garbage out.

  5. 5.What is pseudocode?Show answer

    Structured English description of an algorithm.

Algorithms, Flowcharts and Pseudocode for Problem Solving: frequently asked questions

Does pseudocode have a fixed syntax?

No; it is informal but structured.

Why draw a flowchart?

It shows the logic and flow visually and helps find errors before coding.

What is a connector in a flowchart?

A small circle that joins parts of a flowchart.