program oken; uses crt; var n,d,i: longint; begin clrscr; write(‘Nhap n: ‘); readln(n); i:=2; d:=1; while (i<(n div 2)) do if n mod i=0 then begin d:=d+1; break; end; if d=1 then writeln(n,’ la so nguyen to’) else writeln(n,’ khong phai la so nguyen to’); readln; end.
Var n, i : integer;
Begin
write(‘Nhập số n = ‘);
readln(n);
i := 2;
while (n mod i <> 0) and (i < n) do
i := i + 1;
if i < n then write(n, ‘ là số nguyên tố.’)
else write(n, ‘ là hợp.’)
readln;
End.
program oken;
uses crt;
var n,d,i: longint;
begin
clrscr;
write(‘Nhap n: ‘); readln(n);
i:=2; d:=1;
while (i<(n div 2)) do
if n mod i=0 then
begin
d:=d+1;
break;
end;
if d=1 then
writeln(n,’ la so nguyen to’)
else
writeln(n,’ khong phai la so nguyen to’);
readln;
end.