← IGCSE Computer Science Paper 2

Output with OUTPUT

OUTPUT displays a value to the user. OUTPUT "Hello" shows the text exactly as written. OUTPUT Score shows the value stored in the variable Score.

Understanding Output with OUTPUT in IGCSE Computer Science Paper 2

What it does: Putting the text in double quotes makes OUTPUT display those exact characters. A variable name without quotes shows the value stored in the variable, so 25 is displayed. OUTPUT shows a value to the user. INPUT does the opposite and reads a value from the user. A string needs a closing double quote. The wrong line is missing one.

Common mistakes: Text in double quotes is shown exactly, so this displays the word Score. To show the value stored in the variable (10), remove the quotes: OUTPUT Score. Cambridge pseudocode uses the keyword OUTPUT to display a value, not PRINT. It should be OUTPUT Name.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 327–336) and word search (Modules 317–336).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which statement displays the word Hello exactly as written?
OUTPUT "Hello"OUTPUT Hello
Matches
OUTPUT Hello
↓
The text has no double quotes, so Hello is treated as a variable name instead of text to display. It should be OUTPUT "Hello".
Applying
Meanings
Term
OUTPUT
Meaning
OUTPUT displays a value to the user. OUTPUT "Hello" shows the text exactly as written. OUTPUT Score shows the value stored in the variable Score.
Practice
DECLARE Score : INTEGER
Testing
Gaps
"Hello"
Check Answer
Spots
2Score ← 10
3OUTPUT "Score"

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Giraffe' badge — High Perspective, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which statement displays the word Hello exactly as written?
A. OUTPUT Hello
B. OUTPUT "Hello" ✓
Text in double quotes is a string literal and is shown exactly. Without quotes, Hello would be read as a variable name.
2. Score ← 25. What does OUTPUT Score display?
A. Score
B. 25 ✓
A variable name without quotes shows the value stored in the variable, so 25 is displayed.
3. Score ← 25. What does OUTPUT "Score" display?
A. Score ✓
B. 25
Double quotes make Score plain text, so the word Score is shown. The variable is not read.
4. Which keyword displays a value to the user in Cambridge pseudocode?
A. OUTPUT ✓
B. INPUT
OUTPUT shows a value to the user. INPUT does the opposite and reads a value from the user.
5. Which line shows the value stored in the variable Lives?
A. OUTPUT Lives ✓
B. OUTPUT "Lives"
Leave the quotes off to show the variable's value. With quotes, you only get the word Lives.

Match the Pairs

OUTPUT "Hello" → Displays the text Hello exactly as written, because it is in double quotes
OUTPUT Score → Displays the value currently stored in the variable Score
Show the words Game Over on the screen exactly as written → OUTPUT "Game Over"
Show whatever number is stored in the variable Total → OUTPUT Total
OUTPUT Hello → The text has no double quotes, so Hello is treated as a variable name instead of text to display. It should be OUTPUT "Hello".
OUTPUT "Score" → The quotes make this the word Score rather than the value stored in the variable. To show the value, write OUTPUT Score.

Key Term

OUTPUT
OUTPUT displays a value to the user. OUTPUT "Hello" shows the text exactly as written. OUTPUT Score shows the value stored in the variable Score.

Fill in the Blanks

1. OUTPUT "Hello"
Hint: Type the keyword that displays a value to the user.
2. Score ← 10 OUTPUT Score
Hint: Type the variable name so its stored value is shown, with no quotes.
3. Score ← 42 OUTPUT Score
Hint: Type the keyword that shows the value held in the variable.
4. Lives ← 3 OUTPUT Lives
Hint: Type the variable name whose value should be displayed.
5. Points ← 50 OUTPUT "Points" OUTPUT Points
Hint: The first OUTPUT shows the word as text. Type the variable name, with no quotes, to show the stored value.

Spot the Error

Question 1
A DECLARE Score : INTEGER
B Score ← 10
C OUTPUT "Score"
Line C — Text in double quotes is shown exactly, so this displays the word Score. To show the value stored in the variable (10), remove the quotes: OUTPUT Score.
Question 2
A DECLARE Name : STRING
B Name ← "Sam"
C OUTPUT "Hello"
D PRINT Name
Line D — Cambridge pseudocode uses the keyword OUTPUT to display a value, not PRINT. It should be OUTPUT Name.
Question 3
A OUTPUT "Welcome"
B OUTPUT "to the game"
C OUTPUT "Good luck
Line C — The text is missing its closing double quote. Text must be wrapped in a pair of double quotes: OUTPUT "Good luck".
Question 4
A OUTPUT Enter your name
B INPUT Name
C OUTPUT Name
Line A — Text to be shown exactly must be in double quotes. Without them, Enter your name is not valid. It should be OUTPUT "Enter your name".
Question 5
A DECLARE Score : INTEGER
B Score ← 5
C Score ← Score + 2
D OUTPUT = Score
Line D — OUTPUT is followed directly by the value to display. There is no equals sign. It should be OUTPUT Score.

Student with a class code? Join your class →