Write a Java program to check whether the alphabet is vowel or consonant, for Capital Alphabates.
- class DMSoperators
- {
- public static void main(String [] args)
- {
- char ch= 'B';
- if(ch=='A' || ch=='E' || ch=='I' || ch=='O' || ch=='U')
- {
- System.out.println("Alphabet is a vowel");
- }
- else
- {
- System.out.println("Alphabet is a consonant");
- }
- }
- }
Output:
Alphabet is a consonant
0 Comments