enter character vovel or not java

Solutions on MaxInterview for enter character vovel or not java by the best coders in the world

showing results for - "enter character vovel or not java"
Emily
27 Oct 2018
1/* Java Program Example - Check for Vowel */
2		
3import java.util.Scanner;
4
5public class JavaProgram
6{
7    public static void main(String args[])
8    {
9        char ch;
10        Scanner scan = new Scanner(System.in);
11		
12        System.out.print("Enter an Alphabet : ");
13        ch = scan.next().charAt(0);
14		
15        if(ch=='a' || ch=='A' || ch=='e' || ch=='E' ||
16        ch=='i' || ch=='I' || ch=='o' || ch=='O' ||
17        ch=='u' || ch=='U')
18        {
19            System.out.print("This is a Vowel");
20        }
21        else
22        {
23            System.out.print("This is not a Vowel");
24        }
25    }
26}