Program SO_NGUYEN_TO;
Uses crt;
Var i,n: integer;
Begin
Clrscr;
textcolor (lightgreen+blink);
Writeln('KIEM TRA SO NGUYEN TO:');
textcolor (white);
Writeln('---------------------------------');
textcolor (lightyellow);
Write ('Nhap so can kiem tra n = '); readln(n);
textcolor (white);
If (n=0) or (n=1) then
Writeln(n,' Khong phai la so nguyen to')
Else
Begin
i:=1;
Repeat
i:= i+1;
Until (n mod i= 0) or (i*i>n);
If i*i>n then
Writeln (n,' la so nguyen to')
Else
Writeln (n,' khong phai la so nguyen to');
End;
Readln;
End.
chúc bạn học tốt