-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay-03-Java-Q14
More file actions
61 lines (42 loc) · 1.32 KB
/
Copy pathDay-03-Java-Q14
File metadata and controls
61 lines (42 loc) · 1.32 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
/*Sela wants to learn the alphabets type to implements in the program.could you please her to implements the program.
Input Format
input consists of Character
Constraints
No Constraints
Output Format
if the Given input is A,print the statement is "Upper Case".
if the Given input is a,print the statement is "Lower Case".
if the Given input is 2,print the statement is "Number".
if the Given input is &,print the statement is "Symbol".
Sample Input 0
A
Sample Output 0
The Given Character A is Upper Case...
Sample Input 1
a
Sample Output 1
The Given Character a is Lower Case...
Sample Input 2
4
Sample Output 2
The Given Character 4 is Number...
Sample Input 3
#
Sample Output 3
The Given Character # is Symbol...*/
#Answer
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char ch = sc.next().charAt(0);
System.out.println("The Given Character " + ch + " is " +
(ch >= 'A' && ch <= 'Z' ? "Upper Case..." :
ch >= 'a' && ch <= 'z' ? "Lower Case..." :
ch >= '0' && ch <= '9' ? "Number..." :
"Symbol..."));
sc.close();
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
}
}