Practice
LoopsCoreIGCSE 0478

Find the largest of ten numbers

Running-maximum practice: read ten integers and output the largest value.

A program reads ten integers one after another.

Write pseudocode that outputs the largest of those ten numbers.

Your program should

  • Read ten INTEGER values.
  • Keep a variable for the largest value seen so far.
  • Output the largest value after the loop.

Sample input

4
17
9
23
8
23
1
15
6
12

Sample output

23

Starter

Pseudocode
// Read 10 numbers and output the largest.
DECLARE Index : INTEGER
DECLARE Value : INTEGER
DECLARE Largest : INTEGER