program CheckPrimeNumber;
varN, i: Integer;isPrime: Boolean;
beginisPrime := True;
write('Enter a number: ');readln(N);
if N < 2 thenisPrime := Falseelsebeginfor i := 2 to N - 1 dobeginif N mod i = 0 thenbeginisPrime := False;break;end;end;end;
if isPrime thenwriteln(N, ' is a prime number.')elsewriteln(N, ' is not a prime number.');
end.
program CheckPrimeNumber;
var
N, i: Integer;
isPrime: Boolean;
begin
isPrime := True;
write('Enter a number: ');
readln(N);
if N < 2 then
isPrime := False
else
begin
for i := 2 to N - 1 do
begin
if N mod i = 0 then
begin
isPrime := False;
break;
end;
end;
end;
if isPrime then
writeln(N, ' is a prime number.')
else
writeln(N, ' is not a prime number.');
end.