You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
267 B

READ(input, cell1, 0)
IF input % 2 == 0 THEN
prime = false
ELSE
FOR k = 3 TO SQRT(input) STEP 2
IF input % k == 0 THEN
prime = false
GOTO exit
END IF
NEXT k
prime = true
END IF
exit:
WRITE(prime, cell1, 1)