-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVowelConsonant.java
52 lines (37 loc) · 1.32 KB
/
VowelConsonant.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
package javabeginner;
/**
* @author Md. Talal Wasim
* https://github.com/mdtalalwasim
*/
import java.util.Scanner;
public class VowelConsonant {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter a Letter for Vowel/Consonant!");
char ch = input.next().charAt(0);
if ((ch == 'a' || ch == 'A') || (ch == 'e' || ch == 'E') || (ch == 'i' || ch == 'I') || (ch == 'o' || ch == 'O') || (ch == 'u' || ch == 'U') ) {
System.out.println("Vowel");
}
else{
System.out.println("Consonant");
}
/*if (ch == 'a' || ch == 'A') {
System.out.println("Vowel");
}
else if (ch == 'e' || ch == 'E') {
System.out.println("Vowel");
}
else if (ch == 'i' || ch == 'I') {
System.out.println("Vowel");
}
else if (ch == 'o' || ch == 'O') {
System.out.println("Vowel");
}
else if (ch == 'u' || ch == 'U') {
System.out.println("Vowel");
}
else{
System.out.println("Consonant");
}*/
}
}