-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.java
More file actions
33 lines (31 loc) · 1.13 KB
/
Copy pathoperators.java
File metadata and controls
33 lines (31 loc) · 1.13 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
import java.util.Scanner;
public class operators {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
/*
// --> Arthmetic operator --> + , - , * , / , % , ++ , --
System.out.println(sc.nextInt() + sc.nextInt());
System.out.println(sc.nextInt() - sc.nextInt());
System.out.println(sc.nextInt() * sc.nextInt());
System.out.println(sc.nextInt() / sc.nextInt());
System.out.println(sc.nextInt() % sc.nextInt()); // %--> give remainder
*/
/*
// --> Assignment Operator --> = , += , -= , *=
int a = 10;
System.out.println(a);
int b = 10;
b += 20 ;
System.out.println(b);
*/
// --> Comparision Operator --> == , >= , <= , < , > , !=
// --> LOgical Operator --> && , || , !
// --> Bitwise Operator --> & , | , ! , ^ , << , >>
int a = 100;
int b = 011;
System.out.println(a^b);
System.out.println(a<<b); //(a * 2^b)
System.out.println(a>>b); // (a / 2^b) --> Q
sc.close();
}
}