This script page was blocked. The script was reviewed and it works perfectly so this page doesn't need anymore editing.

This script demonstrates the basic algorithm of determining whether a number is prime or not. It uses the the method of the wrong preposition, where the goal is to determine that the number is not prime. It uses a boolean variable for that.

var x,i:integer;
    IsPrime: boolean;
write ('Type x: '); readln (x);
for i:=2 to x div 2-1 do
if x mod i = 0 then
if IsPrime then
write (x,' is prime.')
write (x,' is not prime.');

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.