-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.java
More file actions
45 lines (41 loc) · 1.52 KB
/
operators.java
File metadata and controls
45 lines (41 loc) · 1.52 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
public class operators {
public static void main(String[] args) {
// int a = 10; // airthmatic operator
// int b = 5;
// System.out.println("sum =" + (a + b));
// System.out.println("subtract = " + (a-b));
// System.out.println("divive =" + (a/b));
// System.out.println("product = " + (a*b));
// System.out.println("modulo = " + (a%b));
// int a= 10; // unery operators
// int b = ++a;
// int b = a++;
// int b = --a;
// int b = a--;
// System.out.println(a);
// System.out.println(b);
// int a = 10; // Relational operators
// int b = 5;
// System.out.println((a == b));
// System.out.println((a!=b));
// System.out.println((a<b));
// System.out.println((a>b));
// System.out.println((a<=b));
// System.out.println((a>=b));
// System.out.println((3>2) && (5>0)); // Logical operators
// System.out.println((3>2) || (5<0));
// System.out.println( !(5<0));
int a = 10; // Assiment operator
//a = a + 10;
//a += 10;
//a = a - 10;
//a -= 10;
//a = a/5;
//a /= 5;
//a = a*10;
//a *= 10;
//a = a % 5;
a %= 5;
System.out.println(a);
}
}