Booleans expressions



Booleans expressions
Smart pascal source code
procedure WriteLnOut(bool : Boolean); begin if bool then WriteLn('True') else WriteLn('False'); end; var t : Boolean = True; f : Boolean = False or False; BEGIN WriteLn(t and f); WriteLn(t or f); WriteLn(t xor f); WriteLn(t xor t); WriteLn(not t); WriteLn(t and (f or t or f) and (t xor f) and not f); WriteLn(''); WriteLn('True = '+IntToStr(Integer(t))+' = '+IntToStr(Integer(True))); WriteLn('False = '+IntToStr(Integer(f))+' = '+IntToStr(Integer(False))); { CONSOLE OUTPUTS False True True False False True True = 1 = 1 False = 0 = 0 }