Loading

Program to check whether the given alphabet is vowel or consonant:                                   

package quipoin.javaeasyprograms;
public class VowelOrConsonant {
    static void vowelOrConsonant(char ch){
        if(ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u'||
        ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U') {
            System.out.println("It is a Vowel!!");
        }
        else {
            System.out.println("It is a Consonant!!");
        }
    }
    public static void main(String[] args) {
        vowelOrConsonant('a');
        vowelOrConsonant('V');
    }
}

Output:

It is a Vowel!!
It is a Consonant!!