QP School
Control flow in Object Pascal - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: Object Pascal Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=50)
+--- Thread: Control flow in Object Pascal (/showthread.php?tid=5044)



Control flow in Object Pascal - Qomplainerz - 07-25-2023

program ControlFlowExample;
begin
  // Variable declaration
  var
    i: Integer;

  for i := 1 to 5 do
  begin
    if i mod 2 = 0 then
      WriteLn(i, ' is even')
    else
      WriteLn(i, ' is odd');
  end;
end.