-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathone.java
67 lines (59 loc) · 2.09 KB
/
one.java
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
63
64
65
66
67
/*
import java.util.Scanner;
public class one {
public static void main (String args[]) {
int a,b,c;
Scanner obj = new Scanner(System.in);
System.out.print("enter the first number ");
a=obj.nextInt();
System.out.print("enter the second number ");
b=obj.nextInt();
/*
//input a=8 b= 11 increment decrement operator
System.out.println(++a); //a=9
System.out.println(a++); //a=9 assign
System.out.println(b--); //b=11 assign
System.out.println(--b); //b=9
System.out.println(++a + b--); //a=11 b= 9 aassign 20
System.out.println(++b - a++); //b=9 a=11 assign -2
System.out.println(a++ - ++b); //a=12 assign b=10 2
System.out.println(--a + --b); //a=12 b=9 21
System.out.println(--b - --a); //b=8 a=11 -3
System.out.println(10/2+5*3-4/2+3*2); //24 priority (),^,*,/,+,-
// arithmatic operator
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);
// relational operator
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);
// logical operator
System.out.print("enter the second number ");
c=obj.nextInt();
System.out.println((a>b) && (a>c));
System.out.println((a>b) || (a>c));
System.out.println((a>b) && (c>a));
System.out.println(!(a>b) || (c>a));
// relational operator
a=9;
a+=10;
System.out.println(a);
// ternary operator
int max;
max=(a>b)?a:b;
System.out.println(max);
*/
/*
// bitwise operator
System.out.println(a & b);
System.out.println(a | b);
System.out.println(a ^ b);
*/
//}
//}