-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest4.p
32 lines (32 loc) · 792 Bytes
/
test4.p
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
VAR a,b,c : INTEGER;
c1,c2: CHAR;
num, denum, frac, intD: DOUBLE;
test: BOOLEAN.
intD:=1.5 + 1;
DISPLAY intD; (*Result => 2.5*)
intD:= 9 - intD;
intD:= intD - 10.5;
DISPLAY intD; (*Result => -4.0*)
intD:= 1.5 * 2;
DISPLAY intD; (*Result => 3.0*)
intD:= 3 / 2;
DISPLAY intD; (*Result => 0 car division de deux entiers*)
intD:= 3.0 / 2;
DISPLAY intD; (*Result => 1.5*)
test:= 3.0 == 3;
DISPLAY test; (*Result => TRUE*)
test:= 3.0 != 3;
DISPLAY test; (*Result => FALSE*)
test:= 3.0 < 3;
DISPLAY test; (*Result => FALSE*)
test:= 3.0 <= 3;
DISPLAY test; (*Result => TRUE*)
test:= 3.0 > 3;
DISPLAY test; (*Result => FALSE*)
test:= 3.0 >= 3;
DISPLAY test; (*Result => TRUE*)
test:= 3.0 < 3.5;
DISPLAY test; (*Result => TRUE*)
num:= 3.0 - 8.0;
test:= num > 0;
DISPLAY test. (*Result => TRUE*)