-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperators.java
More file actions
97 lines (73 loc) · 2.33 KB
/
Operators.java
File metadata and controls
97 lines (73 loc) · 2.33 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
public class Operators{
public static void main(String[] args) {
// int a=12, b=4;
//System.out.println("Remainder:" + (a % b));
// int a=5, b=10;
//int temp = a;
//a = b;
//b = temp;
//System.out.println("a = " + a + ", b =" + b);
// int a = 5, b = 10;
//a = a + b;
//b = a - b;
//a = a - b;
//System.out.println("a = " + a + " , b = " + b);
// int num = 7;
//if(num % 2 ==0)
//System.out.println("Even");
//else
//System.out.println("Odd");
// int a = 10, b = 20, c = 30;
//if(a > b && a > c)
//System.out.println("a is greatest");
//else if (b > c)
//System.out.println("b is greatest");
//else
//System.out.println("c is greatest");
// int year = 2024;
// if(year % 4 == 0 && (year % 100 !=0 || year % 400 == 0))
// System.out.println("Leap year");
//else
//System.out.println("Not a leap year");
// int num = 55;
//if(num % 5 == 0 && num % 11 == 0)
//System.out.println("Divisible by 5 and 11");
//else
// System.out.println("Not divisible");
// char ch = 'a';
// if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u')
//System.out.println("Vowel");
//else
//System.out.println("Consonant");
// int num = 7;
// boolean isPrime = true;
//for(int i = 2; i <=num / 2; i++) {
//if (num % i == 0) {
// isPrime = false;
// break;
// }
// }
//System.out.println(isPrime ? "Prime" : "Not Prime");
//int age =20;
//if( age >=18)
//System.out.println("Eligible to vote ");
//else
//System.out.println("Not Eligible");
// int marks = 85;
//if (marks >= 90)
//System.out.println("Grade A");
//else if (marks >= 75)
//System.out.println("Grade B");
//else if (marks >=60)
//System.out.println("Grade C");
//else
//System.out.println("Fail");
char ch = 'A';
if (ch>= 'A' && ch <= 'Z')
System.out.println("Uppercase");
else if (ch>= 'a' && ch <= 'z' )
System.out.println("Lowercase");
else
System.out.println("Not an alphabet");
}
}