INTEGER data type
The data type for a whole number with no fractional part, written in denary digits, such as 5 or -3. Used for counts like lives: DECLARE Lives : INTEGER
Understanding INTEGER data type in IGCSE Computer Science Paper 2
What it does: Counter is declared as INTEGER, so it can store whole numbers like 0, 5 or 12 but not a value like 2.5. 5 is a whole number written in denary digits, so it can be assigned to an INTEGER variable. -5 would also be valid. Lives is a count of whole things, so INTEGER is the right data type. STRING is for text. 42.0 is written with a decimal point, so it is a REAL literal. 42 has no fractional part, so it is an INTEGER. A DECLARE statement uses a colon between the identifier and the data type, not an equals sign.
Common mistakes: Lives is an INTEGER, so it can only hold whole numbers. Subtracting 0.5 gives a value with a fractional part. It should subtract a whole number such as 1. An INTEGER variable cannot store a number with a fractional part. 2.5 is a REAL value. It should add a whole number such as 5.
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.
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
INTEGERFill in the Blanks
Spot the Error
Student with a class code? Join your class →