Finding the maximum and minimum in pseudocode
Finds the largest value: set Max to the first value, loop through the rest, and replace Max whenever a larger value is found. The minimum works the same way using < instead.
Understanding Finding the maximum and minimum in pseudocode in IGCSE Computer Science Paper 2
What it does: The > operator tests whether the new value beats the current Max, and if so it is stored in Max. The first element is already stored in Max, so the loop only needs to check the rest, starting at index 2. Max is set to the first element, so it begins as a real value from the data. The first element is Scores[1] in IGCSE pseudocode arrays. A larger value means Value is greater than Max, so use >. Using < would find the minimum instead. Assignment in IGCSE pseudocode uses the ← arrow. The = sign is for comparison.
Common mistakes: The assignment is the wrong way round. This line would overwrite the array element with Max and Max would never change. It should be Max ← Mark[Index] so the new largest value is stored in Max. Max must start as the first element, not 0. If every temperature is below 0 (for example -5), Max would stay at 0, which is not in the data. It should be Max ← Temp[1].
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 242–253) and word search (Modules 232–253).
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
IF Value > Max THEN Max ← ValueFill in the Blanks
Spot the Error
Student with a class code? Join your class →