-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathBooleanExample.pas
77 lines (53 loc) · 1.52 KB
/
BooleanExample.pas
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
program If_va_MantiqiyOperatorlar;
var
a, b: Byte;
begin
{
= - tenglikni tekshirish
<> - teng bo'lmasa
> - katta bo'lsa
>= - katta yoki teng bo'lsa
< - kichik bo'lsa
<= - kichik yoki teng bo'lsa
}
begin
a := 21;
b := 10;
if(a = b) then
WriteLn('a, b ga teng')
else
WriteLn('a, b ga teng emas');
if(a < b) then
WriteLn('a, b dan kichik')
else
WriteLn('a, b dan kichik emas');
if(a > b) then
WriteLn('a, b dan katta')
else
WriteLn('a, b dan katta emas');
// O'zgaruvchilarni qiymatlarini o'zgartiramiz
a := 5;
b := 20;
if(a <= b) then
WriteLn('a, b dan kichik yoki teng');
if(b >= a) then
WriteLn('b, a dan katta yoki teng');
end;
begin
a := 5;
b := 10;
// ================ Mantiqiy ko'paytirish ================ //
WriteLn((a = 5) And (b < 5)); // false
WriteLn((a = 4) And (b < 15)); // false &&
WriteLn((a = 5) And (b < 15)); // true
WriteLn((a = 4) And (b < 5)); // false
// ================ Mantiqiy qo'shish ================ //
WriteLn((a = 5) Or (b < 5)); // true
WriteLn((a = 4) Or (b < 15)); // true ||
WriteLn((a = 4) Or (b < 5)); // false
// ================ Inkor ================ //
WriteLn(Not(a = 5)); // false !
WriteLn(Not(a = 4)); // true
end;
ReadLn;
end.