Back to Topics/Fundamentals/Introduction
Page 1.xFundamentals

Introduction to Pseudocode

Discover what pseudocode is, why programmers use it, and how the CIE standard makes algorithms easy to read and translate into any programming language.

6
Sections
12
Activities
12
Questions
Core
Category

1.1 What is Pseudocode?

Pseudocode is a simplified, informal way of describing a computer program or algorithm using a mix of natural language and programming-like structures. It is not a real programming language — you cannot run pseudocode directly on a computer. Instead, it serves as a bridge between human thinking and actual code.

The word "pseudo" means "fake" or "imitation" — so pseudocode literally means "fake code." It looks similar to real programming code but ignores strict syntax rules so you can focus on the logic of your solution rather than the grammar of a specific language.

Key Idea

Pseudocode is about what the program should do, not how a specific programming language spells it.

The Cambridge International Education (CIE) syllabus for IGCSE Computer Science (0478) and AS & A Level (9618) uses a standardised pseudocode format so that students and examiners all share a common language when discussing algorithms.

1.2 Why Use Pseudocode?

Pseudocode is widely used by programmers, teachers, and examiners because it offers several important advantages over jumping straight into a real programming language:

  • 1
    Language-Independent: The same pseudocode can be translated into Python, Java, Visual Basic, or any other language. You learn the logic once and reuse it everywhere.
  • 2
    Focus on Logic: Without worrying about semicolons, brackets, or indentation rules, you can concentrate on the actual problem-solving steps.
  • 3
    Easy to Read: Anyone — even non-programmers — can follow the steps because pseudocode reads like structured English.
  • 4
    Planning Tool: Programmers write pseudocode first to plan, then translate it into the target language — saving debugging time later.
  • 5
    Examinable: CIE exams use pseudocode in algorithm questions, so mastering it is essential for top grades in 0478 and 9618.

1.3 Pseudocode vs Programming Languages

It is important to understand where pseudocode sits compared to real programming languages. The table below highlights the main differences:

FeaturePseudocodeProgramming Language
Runs on a computer?NoYes
Strict syntax rules?No (flexible)Yes (must be exact)
Language-specific?No (universal)Yes (Python, Java, etc.)
Used for planning?YesRarely
Used in CIE exams?Yes (0478 & 9618)No
Translated to code?Yes (manually)N/A — it is code

Notice how the same algorithm can be expressed in multiple ways. Here is a simple "greet the user" algorithm shown in pseudocode and then in two real languages:

Pseudocode
OUTPUT "What is your name?"
INPUT UserName
OUTPUT "Hello, ", UserName

The pseudocode version is short, clear, and could be translated into Python (input()), Java (Scanner.nextLine()), or any other language without changing the underlying logic.

1.4 CIE Pseudocode Standards

Cambridge International Education defines a specific set of pseudocode conventions used in IGCSE (0478) and AS & A Level (9618) exams. Following these conventions exactly is important because examiners expect answers in this format.

Keywords (UPPERCASE)

All keywords are written in UPPERCASE: DECLARE, CONSTANT, IF, THEN, ELSE, ENDIF, WHILE, DO, ENDWHILE, FOR, TO, NEXT, OUTPUT, INPUT, RETURN.

Assignment Operator

Use the arrow <- for assignment — never =. Example:Counter <- 0 means "store 0 in Counter".

Variable Declaration

Variables are declared with type:DECLARE <name> : <type>. Types include INTEGER, REAL, STRING, BOOLEAN, CHAR, ARRAY.

Indentation

Code inside loops, IF statements, and subroutines MUST be indented. This shows structure and is essential for marks in CIE exams.

A complete CIE pseudocode reference is published in the syllabus documents — make sure you keep a printed copy handy while practising algorithm questions.

1.5 Writing Your First Pseudocode

Let's put theory into practice. Here is a complete CIE pseudocode program that asks the user for their name and age, then prints a personalised greeting:

Example: Greeting Program
DECLARE Name : STRING
DECLARE Age : INTEGER

OUTPUT "What is your name?"
INPUT Name

OUTPUT "How old are you?"
INPUT Age

OUTPUT "Hello, ", Name
OUTPUT "Next year you will be ", Age + 1, " years old."

Line-by-line walkthrough:

  1. Lines 1-2: Two variables are declared with their data types. Name holds text, Age holds whole numbers.
  2. Lines 4-5: OUTPUT displays a prompt on screen; INPUT reads the user's response and stores it in Name.
  3. Lines 7-8: Same pattern — ask for and store the age.
  4. Lines 10-11: OUTPUT combines fixed text with the variable values. Note the comma , separates each item to print, and the expression Age + 1 is calculated automatically.

Tip

Always declare variables at the top of your program, use meaningful names, and indent any code inside loops or conditions. These habits will earn you method marks even if your logic has a small mistake.

1.6 Key Points Summary

Here is a quick recap of everything we've covered:

  • Pseudocode is "fake code"It is a human-readable description of an algorithm, not a runnable language.
  • Language-independentThe same pseudocode can be translated into any programming language.
  • CIE standards applyUse UPPERCASE keywords, <- for assignment, and DECLARE for variables.
  • Indentation mattersCode inside IF/WHILE/FOR blocks must be indented for clarity and exam marks.
  • Output & InputOUTPUT displays information; INPUT reads values from the user.
  • Plan first, code secondWrite pseudocode before coding to design your solution clearly.

Question Bank

Test your understanding — 12 multiple-choice questions

Q1

What does the prefix "pseudo" mean in the word "pseudocode"?

Q2

Which statement about pseudocode is TRUE?

Q3

In CIE pseudocode, which symbol is used for assignment?

Q4

Which CIE pseudocode keyword displays text on the screen?

Q5

What is the correct CIE pseudocode syntax for declaring an INTEGER variable named Count?

Q6

Look at this pseudocode. What is the final value of Result?

DECLARE A : INTEGER
DECLARE B : INTEGER
DECLARE Result : INTEGER
A <- 10
B <- 20
Result <- A + B
OUTPUT Result
Q7

Why are keywords in CIE pseudocode written in UPPERCASE?

Q8

Which of these is NOT a standard CIE pseudocode data type?

Q9

What is the primary purpose of writing pseudocode before real code?

Q10

What will this pseudocode output?

OUTPUT "Hello, ", "World"
Q11

Which is the correct way to read a value from the user in CIE pseudocode?

Q12

Which of the following BEST describes the relationship between pseudocode and flowcharts?

Answered 0 of 12 questions