-
Notifications
You must be signed in to change notification settings - Fork 0
/
operators.c
40 lines (34 loc) · 816 Bytes
/
operators.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
#include <stdio.h>
int main()
{
//Arthmetic operators
int a = 10;
int b = 20;
printf("%d \n", a+b);
printf("%d \n", a-b);
printf("%d \n", a*b);
printf("%d \n", a/b);
printf("%d \n", a%b);
printf("%d \n", a++);
printf("%d \n", a--);
printf("%d \n", ++b);
printf("%d \n \n", --b);
//Relational operators
printf("%d \n", a>b);
printf("%d \n", a<b);
printf("%d \n", a>=b);
printf("%d \n", a<=b);
printf("%d \n", a==b);
printf("%d \n \n", a!=b);
//Logical operators
printf("%d \n", a&&b);
printf("%d \n", a||b);
printf("%d \t %d \t %d \n", !a,!b ,!(a&&b));
//Miscellaneous Operators
printf("%d \n " ,sizeof(a));
printf("%d %d \n",&a,&b);
int max;
max = (a>b)?a : b;
printf("%d \n",max);
return 0;
}