Составить программы, на примерах показывающие справедливость всех законов Де Моргана (как я поняла на основе множеств) — Pascal(Паскаль)

not (P and Q) = (not P) or (not Q)
not (P or Q) = (not P) and (not Q)

uses crt;
var p,q:boolean;
begin
clrscr;
writeln('not (P and Q) = (not P) or (not Q)');
for P:=false to true do
for Q:=false to true do
writeln(not (P and Q):6,(not P) or (not Q):6);
writeln('------------------------------');
writeln('not (P or Q) = (not P) and (not Q)');
for P:=false to true do
for Q:=false to true do
writeln(not (P or Q):6,(not P) and (not Q):6);
readln;
end.

Leave a Comment

29 − = 20