← IGCSE Computer Science Paper 2

Calling a procedure with CALL

CALL followed by a procedure name runs that procedure. It is a complete statement written on its own line, e.g. CALL DefaultLine. Control returns to the next line afterwards.

Understanding Calling a procedure with CALL in IGCSE Computer Science Paper 2

What it does: The CALL statement stands alone on a line. It does not need to be placed inside OUTPUT or on the right of an assignment. In Cambridge pseudocode a procedure is run with the keyword CALL followed by its name. The name on its own is not a complete statement. Each CALL runs the procedure again. You can call the same procedure as many times as you need. The condition is false, so only the ELSE branch runs. The CALL in the THEN branch is skipped.

Common mistakes: A procedure is run with a CALL statement. Writing only the name does not run it. Line 3 should be CALL DefaultLine. The keyword CALL must come first, followed by the procedure name. Line 3 should be CALL DefaultLine.

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 399–408) and word search (Modules 399–418).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Which line correctly runs a procedure named DefaultLine that has no parameters?
CALL DefaultLineDefaultLine
Matches
DefaultLine
↓
The keyword CALL is missing, so this is only a name and does not run the procedure. It should be CALL DefaultLine.
Applying
Meanings
Term
CALL DefaultLine
Meaning
CALL followed by a procedure name runs that procedure. It is a complete statement written on its own line, e.g. CALL DefaultLine. Control returns to the next line afterwards.
Practice
PROCEDURE DefaultLine
Testing
Gaps
DefaultLine
Check Answer
Spots
2OUTPUT "Welcome"
3DefaultLine

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

The 'Silverback Gorilla' badge — Savannah Master, 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 runs a procedure named DefaultLine that has no parameters?
A. CALL DefaultLine ✓
B. DefaultLine
In Cambridge pseudocode a procedure is run with the keyword CALL followed by its name. The name on its own is not a complete statement.
2. True or false: CALL DefaultLine is a complete statement and should be written on its own line.
A. True ✓
B. False
A procedure call is a statement by itself, so it sits on its own line. It is not used inside OUTPUT or on the right of an assignment like a function call.
3. A program has CALL DefaultLine on line 3 and OUTPUT "Done" on line 4. What happens after the procedure finishes?
A. The program stops at line 3
B. Control returns and line 4 runs next ✓
When a procedure ends, control passes back to the line after the CALL, so the next statement runs.
4. The program has CALL DefaultLine written twice, one after the other. What happens?
A. The procedure runs twice ✓
B. The procedure runs only once
Each CALL runs the procedure again. You can call the same procedure as many times as you need.
5. Which is the correct way to call a procedure inside a selection? IF Score > 50 THEN ... ELSE ... ENDIF
A. Write DefaultLine after the IF condition
B. CALL DefaultLine on its own line inside THEN or ELSE ✓
A CALL is a normal statement, so it can go on its own line inside the THEN or ELSE part. Only the branch that is chosen will run the procedure.

Match the Pairs

CALL DefaultLine → Runs the procedure named DefaultLine as a complete statement on its own line
CALL DefaultLine CALL DefaultLine → Runs the same procedure twice, once for each CALL line
A procedure call is a complete statement, so it sits on its own line without OUTPUT or an assignment → CALL DefaultLine
CALL can be used inside a selection, so the procedure runs only when its branch is chosen → IF score >= 50 THEN CALL DefaultLine ELSE CALL DefaultLine ENDIF
DefaultLine → The keyword CALL is missing, so this is only a name and does not run the procedure. It should be CALL DefaultLine.
OUTPUT CALL DefaultLine → CALL is a complete statement on its own line and must not be placed inside OUTPUT. It should just be CALL DefaultLine.

Key Term

CALL DefaultLine
CALL followed by a procedure name runs that procedure. It is a complete statement written on its own line, e.g. CALL DefaultLine. Control returns to the next line afterwards.

Fill in the Blanks

1. CALL DefaultLine
Hint: Type the keyword that runs a procedure as a statement on its own line.
2. CALL DefaultLine OUTPUT "Score" CALL DefaultLine
Hint: Type the name of the procedure that is being called a second time.
3. CALL DefaultLine OUTPUT "Menu" CALL DefaultLine
Hint: Type the keyword that runs the same procedure again on its own line.
4. IF Score > 50 THEN CALL DefaultLine ENDIF
Hint: Type the keyword that runs the procedure when the condition is true.
5. IF Score > 50 THEN CALL Pass ELSE CALL Retry
Hint: Type the keyword that separates the call used when the condition is false.

Spot the Error

Question 1
A OUTPUT "Start"
B OUTPUT "Welcome"
C DefaultLine
Line C — A procedure is run with a CALL statement. Writing only the name does not run it. Line 3 should be CALL DefaultLine.
Question 2
A OUTPUT "Scores"
B CALL DefaultLine
C DefaultLine CALL
Line C — The keyword CALL must come first, followed by the procedure name. Line 3 should be CALL DefaultLine.
Question 3
A RUN DefaultLine
B OUTPUT "Hello"
C CALL DefaultLine
Line A — The keyword that runs a procedure is CALL, not RUN. Line 1 should be CALL DefaultLine.
Question 4
A IF Score > 50 THEN
B OUTPUT CALL PrintPass
C ELSE
D CALL PrintFail
E ENDIF
Line B — CALL is a complete statement on its own line. It is not a value to put inside OUTPUT. Line 2 should be CALL PrintPass.
Question 5
A OUTPUT "Report"
B x ← CALL DefaultLine
C OUTPUT "Total: 5"
Line B — A procedure does not return a value, so its result cannot be stored in a variable. Line 2 should be just CALL DefaultLine.

Student with a class code? Join your class →