Check Whether an Alphabet is Vowel or Consonant in Java.
Check Whether an Alphabet is Vowel or Consonant in Java.
Here we will write a java program that checks whether the input character is vowel or Consonant using Switch Case.
EXAMPLE :-
public class vowel {
public static void main(String[] args) {
char ch = 'o';
if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' )
System.out.println(ch + " => is Vowel");
else
System.out.println(ch + " => is Consonant");
}
}
OUTPUT
o => is Vowel
No comments:
Post a Comment
Please do not any spam link in Comment Box