-
Notifications
You must be signed in to change notification settings - Fork 0
/
if else task 18.c
62 lines (47 loc) · 1.51 KB
/
if else task 18.c
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
#include<stdio.h>
#include <stdbool.h>
int main(){
bool var1 = false;
bool var2 = false;
bool var3 = false;
bool var4 = false;
bool var5 = false;
bool var6 = false;
bool result1 = false;
bool result2 = false;
bool result3 = false;
bool result4 = false;
bool result5 = false;
bool result6 = false;
bool result7 = false;
bool result8 = false;
bool result9 = false;
bool result10 = false;
var1 = ((! true) || true) && false;
var2 = var1 && false;
var3 = true && ! false;
var4 = false;
var5 = true;
var6 = var3 && false;
result1 = (var1 && var2) && (40 % 3) > 45 || (var5 && var6);
result2 = (var1 || var2) ||(result1 && false);
result3 = (var1 && result1) || result2 || var5;
result4 = (var1 || var2) || ((var3 && var1) && false);
result5 = (var1 && var2) && (result3 || var1);
result6 = ((var3 || (! var2)) && (result5)) || true;
result7 = (var4 && result1) && ((result1 && false) || true);
result8 = ((var1 && result3) &&((! var5) || var6)) && true;
result9 = ((result2 && var2) || ((! result7) &&var1)) && !false;
result10 = !(var1 && true );
printf("result1: %d\n", result1);
printf("result2: %d\n", result2);
printf("result3: %d\n", result3);
printf("result4: %d\n", result4);
printf("result5: %d\n", result5);
printf("result6: %d\n", result6);
printf("result7: %d\n", result7);
printf("result8: %d\n", result8);
printf("result9: %d\n", result9);
printf("result10: %d\n", result10);
return 0;
}