Information Technology IT – 4 Algorithms and flowcharts | e-Consult
4 Algorithms and flowcharts (1 questions)
Login to see all questions.
Click on a question to view the answer
Pseudo-code:
- START
- INPUT number
IF number WRITE "Not a prime number"
- END IF
FOR i = 2 TO number - 1
- IF number is divisible by i THEN
- WRITE "Not a prime number"
- BREAK (exit the loop)
- END IF
- END FOR
IF the loop completes without finding a divisor THEN
- WRITE "Prime number"
- END IF
- END