public class Main { public static void main(String args[]) { char ch='r'; if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u') { System.out.println("Vowel"); } else { System.out.println("Consonant"); } } }
Consonant
public class Main { public static void main(String args[]) { char ch; ch=args[0].charAt(0); if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u') { System.out.println("Vowel"); } else { System.out.println("Consonant"); } } }
Consonant
import java.util.*; public class Main { public static void main(String args[]) { char ch; Scanner s=new Scanner(System.in); System.out.println("Enter character"); ch=s.next().charAt(0); if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u') { System.out.println("Vowel"); } else { System.out.println("Consonant"); } } }
Enter character
r
Consonant