Boolean Variables

A Boolean variable can have only two values: True and False.

program BooleanVariable;
{$APPTYPE CONSOLE}
var
  Male, Female : Boolean;
begin
  Male := True;
  writeln('I am male. ', Male);
  Female := not Male;
  writeln('I am female. ', Female);
  readln;
end.
Features introduced:
  • Boolean variables
  • Use of the not operator to inter-convert True and False.
Programming - a skill for life!

The various types of constants and variables and how to use them