Write a program in Pascal. Determine if the number entered from the keyboard is prime.

program simpl;
var k, f: integer;
begin
write (‘Enter an integer:’);
read (k);
f: = 0;
// f – divisibility by a number that is different from the entered one

for i: integer: = 2 to k – 1 do
if k mod i = 0 then f: = f + 1;
// if the number is divisible without a remainder by the number of the cycle number i
// then it won’t be simple;
// the value of f is increased by 1.
// the cycle starts at number 2 and ends at the penultimate one
// a number because even a simple one is divisible by 1 and itself
//number

if f = 0 then writeln (k, ‘is a prime number’)
else writeln (k, ‘- is not prime’)
end.



One of the components of a person's success in our time is receiving modern high-quality education, mastering the knowledge, skills and abilities necessary for life in society. A person today needs to study almost all his life, mastering everything new and new, acquiring the necessary professional qualities.