# 4 numbers are entered from the keyboard, find the smallest, largest (if, then, else)

October 4, 2021 | education

| program zz1;

var a, b, c, d, max, min: integer;

begin

write (‘enter the first number’);

read (a);

write (‘enter the second number’);

read (b);

write (‘enter the third number’);

read (c);

write (‘enter the fourth number’);

read (d);

if (a> b) and (a> c) and (a> d) then max: = a;

if (b> a) and (b> c) and (b> d) then max: = b;

if (c> b) and (c> a) and (c> d) then max: = c;

if (d> b) and (d> c) and (d> a) then max: = d;

if (a <b) and (a <c) and (a <d) then min: = a;

if (b <a) and (b <c) and (b <d) then min: = b;

if (c <b) and (c <a) and (c <d) then min: = c;

if (d <b) and (d <c) and (d <a) then min: = d;

writeln (‘greatest =’, max);

write (‘smallest =’, min);

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.