-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.java
More file actions
78 lines (53 loc) · 1.42 KB
/
Copy pathoperators.java
File metadata and controls
78 lines (53 loc) · 1.42 KB
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
78
class operators
{
public static void main(String args[])
{
//Arithmetic operators
int n1 = 8;
int n2 = 5;
System.out.println(n1 + n2);
System.out.println(n1 - n2);
System.out.println(n1 * n2);
System.out.println(n1 / n2);
System.out.println(n1 % n2);
n1 += 2;
System.out.println(n1);
n2 *=3;
System.out.println(n2);
n2++;
System.out.println(n2);
int n3 = 10;
int rez = n3++;
System.out.println(rez);
System.out.println("n3=" + n3);
int rez2 = ++n3;
System.out.println(rez2);
System.out.println(n3);
//Relational operator
int x = 5;
int y = 7;
boolean b1 = x > y;
System.out.println(b1);
boolean b2 = x < y;
System.out.println(b2);
boolean b3 = x >= y;
System.out.println(b3);
boolean b4 = x <= y;
System.out.println(b4);
boolean b5 = x != y;
System.out.println(b5);
boolean b6 = x == y;
System.out.println(b6);
//Logical operators
int p = 7;
int q = 9;
int r = 8;
int s = 6;
boolean b7 = p<q & q>r;
System.out.println(b7);
boolean b8 = p>q || r>s;
System.out.println(b8);
boolean b9 = p!=q;
System.out.println(!b9);
}
}