3)
if (a > b) then
begin
if (c > b) then
k := 1;
end
else
k := 3;
4)
if (a < b) then
5)
// ... что-то делаем ...
k := 2;