Skip to content

Course home

Algorithms

Algorithms

EasyMedium
123456789101112131415161718192021222324252627
Question 11

A student has written a pseudocode algorithm to calculate the product of five numbers entered by the user.

1  SET product TO 0
2  SET counter TO 1
3  WHILE counter <= 5 DO
4      SEND 'Enter a number: ' TO DISPLAY
5      RECEIVE num FROM (INTEGER) KEYBOARD
6      SET product TO product * num
7      SET counter TO counter + 1
8  END WHILE
9  SEND 'The result is ' & product TO DISPLAY

Give the number of the line that contains the logic error.

[1]
Markscheme

Algorithms Questions

  1. IGCSE
  2. /Computer Science
  3. /Algorithms

45 exam-style questions on Edexcel IGCSE Computer Science Algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank