QP School

Full Version: Control flow in Object Pascal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.