Vowels Character Program in Java


import java.util.Scanner;

public class VowelsCharacter
{
    public static void main(String[] args)
    {
        char ch;
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter Character=");
        ch=sc.next().charAt(0);
        switch(ch)
        {
            case 'a':
            case 'A':
            case 'e':
            case 'E':
            case 'i':
            case 'I':
            case 'o':
            case 'O':
            case 'u':
            case 'U':
                System.out.println("Vowel");
                break;
            default:
                System.out.println("Consonant");                
        }
    }
}


Output:

Enter Character=a
Vowel
b. tech. bca icse java java tutorials learn java mca programs