-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperator.java
More file actions
46 lines (38 loc) · 1.21 KB
/
Copy pathOperator.java
File metadata and controls
46 lines (38 loc) · 1.21 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
import java.util.Scanner;
public class Operator {
public static void main(String[] args) {
//arithmetic operator
System.out.println("The use of arithmetic operator ");
int a=10;
int b=6;
int sum=a+b;
int multiplication=a*b;
System.out.println("The use of arithnetic operator" + sum);
System.out.println("The use of arithmetic operator" + multiplication);
//Relational operator
System.out.println("The use of relational operator ");
int age;
Scanner sc=new Scanner(System.in);
age=sc.nextInt();
if(age>=18)
{
System.out.println("U are of legal age");
}
else
{
System.out.println("U are not legal age");
}
//logical operator
System.out.println("The use of logical operator");
System.out.println(65>5 && 2>4);
System.out.println(65>78 || 6>4);
//Bitwise operator
System.out.println("THe use of bitwise operator");
int x=10;
int y=5;
int v=x & y;
int s=x | y;
System.out.println("THe bitwise and :"+ v);
System.out.println("the bitwise or :"+ s);
}
}