-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogic.p
More file actions
96 lines (85 loc) · 1.51 KB
/
logic.p
File metadata and controls
96 lines (85 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
program LogicTest;
const
s = 'OK';
var
a : INTEGER;
r : REAL;
begin
r := 1.0;
a := 1;
{ not equal operator test }
if a <> 0 then
writeln(s);
if a <> 1 then
halt(1);
if r <> 1.1 then
writeln(s);
if r <> 1.0 then
halt(1);
{ equal operator test }
if a = 0 then
halt(1);
if a = 1 then
writeln(s);
if r = 1.1 then
halt(1);
if r = 1.0 then
writeln(s);
{ less than operator test }
if a < 0 then
halt(1);
if a < 1 then
halt(1);
if a < 2 then
writeln(s);
if r < 1.1 then
writeln(s);
if r < 1.0 then
halt(1);
if r < 0 then
halt(1);
{ less than or equal operator test }
if a <= 0 then
halt(1);
if a <= 2 then
writeln(s);
if a <= 1 then
writeln(s);
if r <= 1.1 then
writeln(s);
if r <= 1.0 then
writeln(s);
if r <= 0.9 then
halt(1);
{ greather than operator test }
if a > 0 then
writeln(s);
if a > 1 then
halt(1);
if a > 2 then
halt(1);
if r > 1.1 then
halt(1);
if r > 1.0 then
halt(1);
if r > 0.0 then
writeln(s);
{ greather than or equal operator test }
if a >= 0 then
writeln(s);
if a >= 2 then
halt(1);
if a >= 1 then
writeln(s);
if r >= 1.1 then
halt(1);
if r >= 1.0 then
writeln(s);
if r >= 0.9 then
writeln(s);
{ NOT operator test }
if not a = 0 then
writeln(s);
if not a = 1 then
halt(1);
end.