MCS-201 · Unit 1

Programming Fundamentals

Section 4 of 9

Block 1 · Unit 1Programming Fundamentals17 min · Section 4 of 9

1.4Flowcharts

Covers IGNOU MCS-201 §1.4, 1.4.1

Numbered algorithm steps that say “go to step 4” are hard to follow. A flowchart draws the same algorithm as a picture, so branches and loops are visible at a glance. Drawing a flowchart and writing the matching algorithm is one of the most frequently examined tasks in this unit.

What a flowchart is

The symbols are standardised internationally (ISO 5807). The shape tells the reader what kind of step it is; the text inside says exactly what happens.

Standard symbols

SymbolShapeUsed forExample text
TerminalRounded rectangle (oval)Start or stopStart, Stop
Input/outputParallelogramReading input or printing outputRead n, Print fact
ProcessRectangleCalculation or assignmentsum ← a + b
DecisionDiamondA yes/no question with two exitsi ≤ n ?
FlowlineArrowOrder of execution
ConnectorSmall circleJoins two parts of a chartA
Predefined processRectangle with double side linesCalling a function defined elsewheresort(list)
PreparationHexagonLoop setup (optional)i ← 1
AnnotationOpen bracket with a dashed lineA comment on a step

Standard flowchart symbols with their names

Rules for a correct flowchart

  1. Exactly one Start terminal and at least one Stop terminal.
  2. Flow runs top to bottom and left to right; arrows show direction.
  3. A decision has one entry and exactly two labelled exits (Yes/No or True/False).
  4. Process and input/output symbols have one entry and one exit.
  5. Flowlines should not cross; use connectors when a chart becomes large.

The three control structures

Every flowchart, and every program, can be built from three patterns.

StructureMeaningIn a flowchartIn C (later units)
SequenceSteps run one after anotherSymbols in a straight lineStatements one after another
SelectionChoose one of two pathsA diamond whose two paths rejoin laterif, switch
IterationRepeat stepsA diamond plus an arrow going back to an earlier pointwhile, for, do-while

Choosing the starting value of a loop variable

When a loop builds up a result, the starting value must be one that does not change the result. This is the identity element of the operation:

  • For multiplication, start at 1, because x×1=xx \times 1 = x.
  • For addition, start at 0, because x+0=xx + 0 = x.

Algorithm versus flowchart

AspectAlgorithmFlowchart
FormNumbered steps in plain language or pseudocodeDiagram of standard symbols
Seeing branches and loopsHard: you follow “go to” stepsEasy: visible at a glance
Effort to write or changeQuickSlow to redraw
Large problemsSuitableBecomes big and hard to follow
Closeness to codeClose, especially pseudocodeFurther from code

Both represent the same algorithm. In an exam, the algorithm and the flowchart you give for a problem must describe exactly the same steps.

Key takeaways

  • A flowchart is a picture of an algorithm using standard symbols.
  • Sequence, selection and iteration are enough to express any algorithm.
  • A loop appears as a decision with an arrow back to an earlier point.
  • Start sums at 0 and products at 1.

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

Which symbol is used for “Read the invoice file”?

Show answer

Answer: C. Parallelogram

Reading input and printing output use the parallelogram. A rectangle is for calculations and assignments.

Question 2 · multiple choice

A student draws Start and Stop as small circles. What is wrong?

Show answer

Answer: B. A small circle is the connector symbol; terminals are ovals (rounded rectangles)

Ovals mark Start and Stop. A small circle is a connector, so a circle labelled “Stop” reads as a connector named Stop.

Question 3 · multiple choice

How is iteration (a loop) shown in a flowchart?

Show answer

Answer: D. A decision with an arrow that goes back to an earlier point

The arrow returning to an earlier point creates the repetition. A diamond whose paths rejoin further down is selection, not iteration.

Question 4 · multiple choice

The factorial flowchart is changed to compute 1 + 2 + … + n. Which initial values are correct?

Show answer

Answer: A. i ← 1, sum ← 0

Addition must start from 0, its identity element. Keeping 1 adds an extra 1 to the result (7 instead of 6 for n = 3).

Question 5 · multiple choice

Which of these belongs inside a decision symbol?

Show answer

Answer: C. total > 10000 ?

A decision holds a yes/no question. An assignment belongs in a rectangle and printing in a parallelogram.

Question 6 · multiple choice

Which statement about algorithms and flowcharts is correct?

Show answer

Answer: D. Both represent the same method; a flowchart makes branches and loops easier to see

They are two representations of one algorithm, so their steps must match. Flowcharts are slower to change and become unwieldy for large problems.

Question 7 · short answer

Write an algorithm to find the sum of the first n natural numbers, and list the flowchart symbols in order with the text inside each.

Show worked answer

Algorithm: 1. Start. 2. Read n. 3. i ← 1, sum ← 0. 4. While i ≤ n, repeat steps 5 and 6. 5. sum ← sum + i. 6. i ← i + 1. 7. Print sum. 8. Stop. Flowchart: oval “Start” → parallelogram “Read n” → rectangle “i ← 1, sum ← 0” → diamond “i ≤ n ?”; Yes → rectangle “sum ← sum + i” → rectangle “i ← i + 1” → arrow back to the diamond; No → parallelogram “Print sum” → oval “Stop”. Check with n = 4: 1 + 2 + 3 + 4 = 10.

↑ ↓ move↵ openTab switch type