Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
24
Task/Logical-operations/Modula-2/logical-operations.mod2
Normal file
24
Task/Logical-operations/Modula-2/logical-operations.mod2
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
MODULE LogicalOps;
|
||||
FROM FormatString IMPORT FormatString;
|
||||
FROM Terminal IMPORT WriteString,WriteLn,ReadChar;
|
||||
|
||||
PROCEDURE Print(a,b : BOOLEAN);
|
||||
VAR buf : ARRAY[0..31] OF CHAR;
|
||||
BEGIN
|
||||
FormatString("a and b is %b\n", buf, a AND b);
|
||||
WriteString(buf);
|
||||
FormatString("a or b is %b\n", buf, a OR b);
|
||||
WriteString(buf);
|
||||
FormatString("not a is %b\n", buf, NOT a);
|
||||
WriteString(buf);
|
||||
WriteLn
|
||||
END Print;
|
||||
|
||||
BEGIN
|
||||
Print(FALSE, FALSE);
|
||||
Print(FALSE, TRUE);
|
||||
Print(TRUE, TRUE);
|
||||
Print(TRUE, FALSE);
|
||||
|
||||
ReadChar
|
||||
END LogicalOps.
|
||||
Loading…
Add table
Add a link
Reference in a new issue