Java Program To Check Vowel Or Not
Chapter:
Interview Programs
Last Updated:
25-09-2018 18:08:38 UTC
Program:
/* ............... START ............... */
import java.util.Scanner;
public class JavaVowelOrNot {
public static void main(String args[]) {
char ch;
Scanner scan = new Scanner(System.in);
System.out.print("Enter an Alphabet : ");
ch = scan.next().charAt(0);
if (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' ||
ch == 'I' || ch == 'o' || ch == 'O'
|| ch == 'u' || ch == 'U') {
System.out.print("This is a Vowel");
} else {
System.out.print("This is not a Vowel");
}
}
}
/* ............... END ............... */
Output
Enter an Alphabet : a
This is a Vowel
Enter an Alphabet : h
This is not a Vowel
Tags
Check Vowel Or Not, Java, Interview Programs, java program to check vowel or consonant, java program to find vowels in a string,
java program to check vowel or consonant using if else, java program to print vowels in a string