Write a Java program to check whether the alphabet is vowel or consonant, for Capital Alphabates.

  1. class DMSoperators
  2. {  
  3. public static void main(String [] args)
  4. {
  5. char ch= 'B'
  6. if(ch=='A' || ch=='E' || ch=='I' || ch=='O' || ch=='U')
  7. {
  8. System.out.println("Alphabet is a vowel");
  9. }
  10. else
  11. {
  12. System.out.println("Alphabet is a consonant");
  13. }
  14. }

Output:

Alphabet is a consonant