Solutions de l'exercice 3 du  TP n°2 (informatique en S1 DEUG MAIS+MASS)

PROGRAM TP2exc3 ;

VAR P, Q : boolean ;

BEGIN
Writeln('P':8, 'Q':8, 'P et Q':8, 'P ou Q':8, 'P => Q':8, 'P <=> Q':8) ;
P:=true ;
Q:=true ;
writeln(P:8, Q:8, (P and Q):8, (P or Q):8, (Q or not P):8, ((Q or not P) and (P or not Q)):8) ;
Q:=false ;
writeln(P:8, Q:8, (P and Q):8, (P or Q):8, (Q or not P):8, ((Q or not P) and (P or not Q)):8) ;
P:=false ;
writeln(P:8, Q:8, (P and Q):8, (P or Q):8, (Q or not P):8, ((Q or not P) and (P or not Q)):8) ;
Q:=true ;
writeln(P:8, Q:8, (P and Q):8, (P or Q):8, (Q or not P):8, ((Q or not P) and (P or not Q)):8) ;
END.