Skip to study material
← Question index

QUESTION 15 · Logic building

State two differences between a flowchart and pseudocode.

2 marks

Answer

A flowchart represents logic using a diagram, while pseudocode describes it as structured text.

  • A flowchart uses symbols and arrows; pseudocode uses statements and indentation.
  • A flowchart makes paths visible; pseudocode is usually easier to edit for longer procedures.

QUESTION 16 · Logic building

Differentiate an algorithm, a flowchart and pseudocode.

5 marks

Answer in brief

An algorithm is the step-by-step solution to a problem. A flowchart and pseudocode are two ways of presenting that solution.

Algorithm

An algorithm is usually written as numbered steps. It states what input is needed, what actions must be performed and what result must be produced. It is useful for explaining a short solution in ordinary language.

Flowchart

A flowchart presents the steps as a diagram. Rectangles show processing, diamonds show decisions and arrows show the direction of execution. It is useful when we need to see different choices or repeated paths. Large charts can be difficult to draw and change.

Pseudocode

Pseudocode uses structured text such as READ, IF, WHILE and OUTPUT. It is useful for writing longer logic before choosing the exact C syntax. It is generally easier to edit than a large diagram.

Example: sum of two numbers

The algorithm says: read two numbers, add them and display the sum. Pseudocode writes the same actions using named variables. The flowchart uses Start, input, process, output and End symbols. All three must describe the same calculation.

READ a, b
sum ← a + b
OUTPUT sum

Important difference

The solution itself does not change when its presentation changes. For example, a condition must not become its opposite when it is copied from pseudocode to a flowchart. Check that the starting values, conditions and output agree in every version. None of these ordinary descriptions is automatically an executable C program.

Reference table

↔ Scroll horizontally on a small screen
Three ways to discuss a solution
AspectAlgorithm as numbered stepsFlowchartPseudocode
FormA sequence of precisely written stepsConnected graphical symbolsIndented, structured text
StrengthEasy to introduce in ordinary languageMakes branches and loops visibleScales well to detailed structured logic
EditingSimple for short descriptionsLayout may need rearrangingUsually easy to revise
ExecutionNot directly executableNot directly executableNot directly executable
CorrectnessDepends on the logicDepends on the same logicDepends on the same logic

Key points

  • The algorithm is the logic, rather than a particular drawing format.
  • Different representations must agree on decisions and results.

Related exam questions

Topic matches from the supplied JNTUH papers. Marks below are the printed allocations for those questions.

  • January/February 2024 · Q2(b) · 5 marks

    Discuss the importance of flowcharts and pseudocode in designing algorithms.

    Paper P08 · page 1
View all matching exam references →