-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCapitalSmallDemo.java
More file actions
51 lines (51 loc) · 1.32 KB
/
CapitalSmallDemo.java
File metadata and controls
51 lines (51 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
package my_frist_java;
/**
* @author ARIFUL ISLAM
*/
import java.util.Scanner;
public class CapitalSmallDemo {
/*public static void main(String[] args) {
Scanner input = new Scanner(System.in);
char ch;
System.out.print("Enter any letter : ");
ch =input.next().charAt(0);
if(ch>='a' && ch<='z')
{
System.out.println("Small Letter");
}
else if(ch>='A' && ch<='Z')
{
System.out.println("Capital Letter");
}
else if(ch>='0' && ch<='9')
{
System.out.println("Digit");
}
else
{
System.out.println("It is not a letter");
}
}*/
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
char ch;
System.out.print("Enter any letter : ");
ch = input.next().charAt(0);
if(ch>='a' && ch<='z')
{
System.out.println("Small Letter");
}
else if(ch>='A' && ch<='Z')
{
System.out.println("Capial Letter");
}
else if (ch>='0' && ch<='9')
{
System.out.println("Digit");
}
else
{
System.out.println("It's Not a Letter");
}
}
}