-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupper_or_lower.java
More file actions
23 lines (21 loc) · 650 Bytes
/
Copy pathupper_or_lower.java
File metadata and controls
23 lines (21 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package conditionals;
import java.util.Scanner;
public class upper_or_lower {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter the Character : ");
char x = input.next().trim().charAt(0);
System.out.println(x);
if (x >= 'a' && x <= 'z') {
System.out.println("lower case");
} else if (x >= 'A' && x <= 'Z') {
System.out.println("upper case");
}
else if(x >= '0' && x <= '9') {
System.out.println("digit");
}
else{
System.out.println("invalid");
}
}
}