← IGCSE Computer Science Paper 2

CHAR data type

The data type for exactly one character (a letter, digit or symbol), written in single quotes, such as 'x', '7' or '@'. Even '7' is a character, not a number.

Understanding CHAR data type in IGCSE Computer Science Paper 2

What it does: 'x' is one character in single quotes, so it is a valid CHAR value. A CHAR holds exactly one character. This can be a letter, a digit or a symbol such as '@'. '@@' has two characters. Each option is a single letter, so CHAR is the best choice.

Common mistakes: A CHAR holds exactly one character. 'BC' is two characters, so it would need to be a STRING. It should be grade ← 'B'. CHAR values are written in single quotes, not double quotes. It should be symbol ← '@'.

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 317–326) 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 value is a valid CHAR literal?
"x"'x'
Matches
Initial ← "B"
↓
Double quotes were used. A CHAR value must be written in single quotes: 'B'.
Applying
Meanings
Term
CHAR
Meaning
The data type for exactly one character (a letter, digit or symbol), written in single quotes, such as 'x', '7' or '@'. Even '7' is a character, not a number.
Practice
DECLARE Grade : CHAR
Testing
Gaps
DECLARE Initial :
Check Answer
Spots
2DECLARE name : STRING
3grade ← 'BC'

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

The 'Kraken' badge — Deep Sea 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 value is a valid CHAR literal?
A. 'x' ✓
B. "x"
CHAR values are written in single quotes. Double quotes are used for STRING values.
2. Which value can be stored in a CHAR variable?
A. '@' ✓
B. '@@'
A CHAR holds exactly one character. This can be a letter, a digit or a symbol such as '@'. '@@' has two characters.
3. Which statement about '7' is correct?
A. '7' is an INTEGER, because 7 is a number
B. '7' is a CHAR, because it is a single character in quotes ✓
The single quotes make '7' a character. It is not a number, so you cannot use it as one in a calculation.
4. Which declaration creates a variable that holds one letter?
A. DECLARE Grade : CHAR ✓
B. DECLARE Grade : LETTER
CHAR is the Cambridge pseudocode data type for a single character. LETTER is not a data type.
5. Which assignment is correct for Initial, a CHAR variable?
A. Initial ← 'Mia'
B. Initial ← 'M' ✓
A CHAR can only hold one character. 'Mia' has three characters, so it needs a STRING.

Match the Pairs

DECLARE Grade : CHAR → Declares a variable named Grade that can store exactly one character
Symbol ← '@' → Stores the symbol @ in a CHAR variable using single quotes
A CHAR literal is exactly one character inside single quotes → Letter ← 'x'
A digit in single quotes is a character, not a number, so it is a CHAR value → Digit ← '7'
Initial ← "B" → Double quotes were used. A CHAR value must be written in single quotes: 'B'.
Letter ← 'AB' → A CHAR holds exactly one character, but 'AB' has two. Use one character such as 'A' or change the type to STRING.

Key Term

CHAR
The data type for exactly one character (a letter, digit or symbol), written in single quotes, such as 'x', '7' or '@'. Even '7' is a character, not a number.

Fill in the Blanks

1. DECLARE Initial : CHAR
Hint: Type the data type for storing exactly one character, such as a letter.
2. DECLARE Digit : CHAR Digit ← '7'
Hint: Type the assignment operator that stores the character in the variable.
3. DECLARE Symbol : CHAR Symbol ← '@'
Hint: Type the keyword that creates a new variable before its data type is given.
4. DECLARE Initial : CHAR Initial ← 'K' OUTPUT Initial
Hint: Type the keyword that displays the character stored in the variable.
5. DECLARE Symbol : CHAR Symbol ← '#'
Hint: Type the punctuation that separates the variable name from its data type.

Spot the Error

Question 1
A DECLARE grade : CHAR
B DECLARE name : STRING
C grade ← 'BC'
D OUTPUT grade
Line C — A CHAR holds exactly one character. 'BC' is two characters, so it would need to be a STRING. It should be grade ← 'B'.
Question 2
A DECLARE symbol : CHAR
B symbol ← "@"
C OUTPUT symbol
Line B — CHAR values are written in single quotes, not double quotes. It should be symbol ← '@'.
Question 3
A DECLARE digit : INTEGER
B digit ← '7'
C OUTPUT digit
Line A — '7' is a character, not a number, so the variable must be declared as CHAR. It should be DECLARE digit : CHAR.
Question 4
A DECLARE letter : CHAR
B letter ← x
C OUTPUT letter
Line B — A CHAR literal needs single quotes. Without them, x looks like a variable name. It should be letter ← 'x'.
Question 5
A DECLARE code : CHAR
B code ← 7
C OUTPUT code
Line B — 7 without quotes is an INTEGER. A CHAR must hold a character, so the digit needs single quotes: code ← '7'.

Student with a class code? Join your class →