Check vowel or constant in java
10. Check vowel or constant in java package com.company ; import java.util.Scanner ; public class Main { public static void main ( String [] args ) { // write your code here Scanner sc = new Scanner ( System . in ); System . out . println ( "Enter alphabet to check alphabet is vowel or constant" ); char alphabet = sc . next (). charAt ( 0 ); if ( alphabet == 'a' || alphabet == 'e' || alphabet == 'i' || alphabet == 'o' || alphabet == 'u' ) { System . out . println ( alphabet + " is vowel" ); } else System . out . println ( alphabet + " is constant" ); } } output:- h is constant Process finished with exit code 0