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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
public class VowelConsonant {

    public static void main(String[] args) {

        char ch = 'i';

        if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' )
            System.out.println(ch + " is vowel");
        else
            System.out.println(ch + " is consonant");

    }
}

Final output

1 thought on “Write a Java Program to Check Whether an Alphabet is Vowel or Consonant”

Leave a Comment