-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRe_lo_etc_operator.c
49 lines (36 loc) · 1.26 KB
/
Re_lo_etc_operator.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
#include<stdio.h>
int main(){
printf("%d\n",5!=5); //I think it will return 0 (false.)
printf("%d\n",5==5); //I think it will return 1 (true.)
printf("%d\n",5>5); //I think it will return 0 (false.)
printf("%d\n",5<5); //I think it will return 0 (false.)
printf("%d\n",5<=5); //I think it will return 1 (true.)
printf("%d\n",5>=5); //I think it will return 1 (ture.)
//......now we will see some the logical Operators
printf("%d\n",(5<4)&&(5<7));// It will return 0(false.)
printf("%d\n",(5<4)||(5<7));// It will return 1(true.)
printf("%d\n",!(5<7)); // It will return 1(true.)
//....some of 'Assignment operator'
int a = 3;
int b = 4;
a -= b;
printf("%d\n ",a);
//......solve simple question.
int m;
printf("Enter a number:");
scanf("%d",&m);
printf(" The result is:%d\n", m%2==0);
//........another one..
int is_sunday = 1;
int is_snowing = 1;
printf("%d\n",is_sunday&&is_snowing);
int is_monday = 1;
int is_raining = 0;
printf("%d\n",is_monday||is_raining);
//......another one..
int aa;
printf("Enter a number for checking:");
scanf("%d",&aa);
printf("see the result:%d",aa>9 && aa<100);
return 0;
}