Skip to content
MathsGenie logo
Open app

Course home

  1. IGCSE
  2. Computer Science Edexcel
  3. Question bank

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]

Algorithms Questions

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