Choosing between CHAR and STRING
Use CHAR for a value that is always exactly one character, like a grade letter or Y/N. Use STRING for text of any length, including none, like a name or phone number.
Understanding Choosing between CHAR and STRING in IGCSE Computer Science Paper 2
What it does: Names vary in length (Al, Alexandra), so STRING is needed rather than CHAR. An answer of 'Y' or 'N' is exactly one character, so CHAR is the best choice. A phone number is not used in calculations, and an INTEGER would lose the leading zero. Store it as STRING. A city name such as "Paris" has many characters, so it needs STRING. A grade letter is always a single character, so CHAR is the right data type.
Common mistakes: A phone number is not used in calculations and can start with 0, so it must be STRING. INTEGER would drop the leading zero. It should be DECLARE Phone : STRING. Single quotes make a CHAR literal, which holds exactly one character. A name is a STRING and needs double quotes: Name ← "Sam".
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.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
CHAR or STRINGFill in the Blanks
Spot the Error
Student with a class code? Join your class →