Showing posts with label Check Whether an Alphabet is Vowel or Consonant in Java.. Show all posts
Showing posts with label Check Whether an Alphabet is Vowel or Consonant in Java.. Show all posts

Tuesday, August 11, 2020

Write a Program to Check Whether an Alphabet is Vowel or Consonant in Java.

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