-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.java
More file actions
57 lines (37 loc) · 1.27 KB
/
operators.java
File metadata and controls
57 lines (37 loc) · 1.27 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
public class operators{
public static void main (String[]args){
int a = 10;
int b = 3;
int sum= a+ b;
int difference= a-b;
int product=a*b;
int division =a/b;
int modulo=a%b;
int x=5;
x+=2;
x*=3;
boolean isGreater = a>b;
boolean isEqual = a == b;
boolean logiacalResult = (a>b)&&(b>0);
int negative = -a;
boolean notTrue = !true;
int preinc = ++a;
int postDec = b--;
int max = (a>b) ? a:b;
System.out.println("sum:" + sum/n );
System.out.println("difference: " + difference);
System.out.println("product:" +product );
System.out.println("division:" +division );
System.out.println("modulo" +modulo );
System.out.println("Assignment result x:" + X );
System.out.println("Is a greater than b?" + isGreator );
System.out.println("Is a eaual to b" + isEqual );
System.out.println("Logical And Result" + logicalresult );
System.out.println("Unary negative of a:" + negative );
System.out.println("Not true" + notTrue );
System.out.println("Pre Increment a:" + preinc );
System.out.println("post Decrement" + postDec );
System.out.println("Final value of b" + b );
System.out.println("Maximum Value :" + max );
}
}