Find the greater of four numbers in Pascal (make a program)

a, b, c, d: integer;

function max (a, b: integer): integer;
if a> b then max: = a
else max: = b;

write (‘Enter the first number:’); readln (a);
write (‘Enter the second number:’); readln (b);
write (‘Enter the third number:’); readln (c);
write (‘Enter the fourth number:’); readln (d);
writeln (‘The largest number among those entered:’, max (max (a, b), max (c, d)));
