← All examples

case .. of

Pascal Switch / case

case in Pascal

Flowchart (ISO 5807)

YesNoYesNoStartInput cc = 1Output «Червоний»c = 2Output «Зелений»Output «Інший»EndFigure 1 — Colors

Source code

program Colors;
var c: integer;
begin
  readln(c);
  case c of
    1: writeln('Червоний');
    2: writeln('Зелений');
  else
    writeln('Інший');
  end;
end.