-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path17_Operators.java
More file actions
62 lines (52 loc) · 1.63 KB
/
17_Operators.java
File metadata and controls
62 lines (52 loc) · 1.63 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
import java.util.*;
class Solution {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a = 10;
int b = 20;
int c = 25;
int d = 25;
System.out.println("a + b = " + (a + b));
System.out.println("a + b = " + a + b);
System.out.println("a - b = " + (a - b));
System.out.println("a * b = " + (a * b));
System.out.println("a / b = " + (a / b));
System.out.println("a % b = " + (a % b));
System.out.println("c % b = " + (c % b));
System.out.println("c / b = " + (c / b));
System.out.println("a++ = " + (a++));
System.out.println("a-- = " + (a--));
System.out.println("++a + b = " + (++a + b));
char c1 = 'A';
char c2 = 'A';
System.out.println("c1 + c2 = " + (c1 + c2));
System.out.println(d + " " + (++d) + " " + (d++));
}
}
class Solution1 {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int c = 21;
int a = 15;
c =- a;
System.out.println(c);
}
}
class Solution2 {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a = 15, b = 21, c = 13;
c = a + b;
System.out.println("c = a + b = " + c);
c -= a;
System.out.println("c -= a = " + c);
c *= a;
System.out.println("c *= a = " + c);
c /= a;
System.out.println("c /= a = " + c);
c %= a;
System.out.println("c %= a = " + c);
c =- a;
System.out.println("c =- a = " + c);
}
}