with Ada.Text_IO,Ada.Integer_Text_IO;
use Ada.Text_IO,Ada.Integer_Text_IO;
procedure Compares is
package Enum_IO is new Ada.Text_IO.Enumeration_IO(Boolean);
use Enum_IO;
Index,Count :Integer :=12;
Truth,Lies,Question :Boolean;
begin
Truth :=Index=Count;--this is true
Lies :=Index<Index;--this is false-- example of all boolean operators
Question:=Index=Count;-- equality
Question:=Index/=Count;-- Inequality
Question:=Index>=Count;-- greater than or equal
Question:=Index<=Count;-- less than or equal
Question:=Index>Count;-- greater than
Question:=Index<Count;-- less than
-- example of all boolean operators
Question:=Index=12and Count=12and Truth and True;
Question:=Index/=12or False or Count>3or Truth;
Question:=(Truth or Lies)and(Truth andnot Lies);
Question:=True xor Lies;-- now forshort circuit evaluation
Question:=Index/=Count and then Index =9/(Index-Count);
Question:=Index=Count orelse Index=9/(Index-Count);
Question:=(Index=Count)orelse(Index=9/(Index-Count));
end Compares;