← IGCSE Computer Science Paper 2

OUTPUT

Displays text in double quotes, variable values or expressions on screen. Several values are separated by commas, e.g. OUTPUT "Score: ", Score

Understanding OUTPUT in IGCSE Computer Science Paper 2

What it does: The double quotes tell the computer to display the characters Game over exactly as they are. The computer works out Score * 2 first, then displays the answer instead of the expression itself. Text must be written in double quotes. Without quotes, Hello would be treated as a variable name. Several values in one OUTPUT statement must be separated by commas. Pseudocode keywords are written in upper case, so OUTPUT is correct.

Common mistakes: Several values in an OUTPUT statement must be separated by commas. The comma is missing between the text and Score. It should be OUTPUT "Score: ", Score. Text to display must be written in double quotes. Without quotes, pseudocode treats the words as variable names. It should be OUTPUT "Enter your 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 156–165) and word search (Modules 146–165).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which line correctly displays the text Hello on the screen?
OUTPUT "Hello"OUTPUT Hello
Matches
OUTPUT "Score"
↓
The variable name is inside double quotes, so the word Score is displayed instead of the value stored in the variable. Remove the quotes to output the value.
Applying
Meanings
Term
OUTPUT
Meaning
Displays text in double quotes, variable values or expressions on screen. Several values are separated by commas, e.g. OUTPUT "Score: ", Score
Practice
Score ← 10
Testing
Gaps
"Score: ", Score
Check Answer
Spots
3Score ← Score + 5
4OUTPUT "Score: " Score

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

The 'Cosmic Owl' badge — Comprehension Guru, 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 line correctly displays the text Hello on the screen?
A. OUTPUT "Hello" ✓
B. OUTPUT Hello
Text must be written in double quotes. Without quotes, Hello would be treated as a variable name.
2. Score holds the number 50. Which line displays the value 50?
A. OUTPUT "Score"
B. OUTPUT Score ✓
A variable name is written without quotes to display its value. With quotes, the word Score itself is displayed.
3. What does OUTPUT "Score" display?
A. The value stored in the variable Score
B. The word Score ✓
Anything inside double quotes is displayed exactly as written, even if it matches a variable name.
4. Lives holds 3. Which line displays: You have 3 lives left?
A. OUTPUT "You have ", Lives, " lives left" ✓
B. OUTPUT "You have " Lives " lives left"
Several values in one OUTPUT statement must be separated by commas.
5. Which keyword is used in IGCSE pseudocode to display a value on the screen?
A. OUTPUT ✓
B. output
Pseudocode keywords are written in upper case, so OUTPUT is correct.

Match the Pairs

OUTPUT Score → Displays the current value stored in the variable Score on the screen
OUTPUT "You have ", Lives, " lives left" → Displays text and a variable value together, with the values separated by commas
Text must be written inside double quotes so it is displayed exactly as written → OUTPUT "Game over"
An expression can be output and the result of the calculation is displayed → OUTPUT Score * 2
OUTPUT "Score" → The variable name is inside double quotes, so the word Score is displayed instead of the value stored in the variable. Remove the quotes to output the value.
OUTPUT "You have " Lives " lives left" → The commas are missing between the values. Each text and variable must be separated by commas.

Key Term

OUTPUT
Displays text in double quotes, variable values or expressions on screen. Several values are separated by commas, e.g. OUTPUT "Score: ", Score

Fill in the Blanks

1. Score ← 50 OUTPUT "Score: ", Score
Hint: Type the keyword that displays values on the screen.
2. Lives ← 3 OUTPUT "You have ", Lives, " lives left"
Hint: Type the variable name whose value is shown between the two pieces of text.
3. Score ← 10 Bonus ← 5 OUTPUT Score + Bonus
Hint: Type the arithmetic operator that adds the two values in the expression.
4. Name ← "Sam" OUTPUT "Hello ", Name
Hint: Type the variable name that holds the person's name; it is not in quotes.
5. Price ← 8 Qty ← 3 OUTPUT "Cost: ", Price * Qty
Hint: Type the operator that multiplies the price by the quantity.

Spot the Error

Question 1
A DECLARE Score : INTEGER
B Score ← 10
C Score ← Score + 5
D OUTPUT "Score: " Score
Line D — Several values in an OUTPUT statement must be separated by commas. The comma is missing between the text and Score. It should be OUTPUT "Score: ", Score.
Question 2
A OUTPUT Enter your name
B INPUT Name
C OUTPUT "Hello ", Name
Line A — Text to display must be written in double quotes. Without quotes, pseudocode treats the words as variable names. It should be OUTPUT "Enter your name".
Question 3
A Lives ← 3
B Lives ← Lives - 1
C OUTPUT "You have ", "Lives"
Line C — A variable must not be in double quotes, or the word Lives is displayed instead of its value. It should be OUTPUT "You have ", Lives.
Question 4
A Price ← 4
B Qty ← 3
C Total ← Price * Qty
D OUTPUT "Total: "; Total
Line D — Values in an OUTPUT statement are separated by commas, not semicolons. It should be OUTPUT "Total: ", Total.
Question 5
A Side ← 5
B OUTPUT "Area: ", "Side * Side"
C OUTPUT "Done"
Line B — An expression must not be in quotes, or the characters Side * Side are displayed as text. Without quotes OUTPUT works out the value. It should be OUTPUT "Area: ", Side * Side.

Student with a class code? Join your class →