Write a Program to Find Vowel Checking a String Using Java Programming

import java.util.Scanner;
public class Vowel_Checking {
	public static void main(String[] args) {
		char vowelArrray[] = null;
		vowelArrray = new char[] { 'A', 'E', 'I', 'O', 'U' };
		Scanner userinput = new Scanner(System.in);
		System.out.println("Enter the Character to check the Vowel: ");
		char character = userinput.next().charAt(0);
		for (char checkVowel : vowelArrray) {
			if (Character.toUpperCase(character) != checkVowel) {
				System.out.println("Not Vowel!");
			} else {
				System.out.println(character + " is Vowel...");
			}
		}
		userinput.close();
	}
}

Output:

Vowel_Checking

(Visited 102 times, 1 visits today)
Share with Friends :
Written by: