# Pascal. Create a program for a user-entered number (integer or not; positive, negative or zero; even or odd)

August 19, 2021 | education

| program zz1;

var n: string; // set a variable of string type

begin

write (‘enter n’); // enter a number from the keyboard

read (n);

if (pos (‘,’, n) = 0) then writeln (‘integer number’) else writeln (‘not integer number’);

if n [1] = ‘-‘ then writeln (‘the number is negative’) else if n [1] = ‘0’ then writeln (‘the number is zero’)

else writeln (‘positive number’);

if (n [length (n)] = ‘0’) or (n [length (n)] = ‘2’) or (n [length (n)] = ‘4’)

or (n [length (n)] = ‘6’) or (n [length (n)] = ‘8’) then writeln (‘the number is even’) else writeln (‘the number is not even’);

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.