Java Program

Object:-Write a Program to check whether given alphabet is vowel or not.

import java.util.Scanner;
public class JavaProgram
 public static void main(String args[])
  char ch;
  Scanner scan = new Scanner(;            
  System.out.print("Enter an Alphabet : ");
  ch =;                
  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");
   System.out.print("This is not a Vowel");


Enter an Alphabet :a
This is a Vowel


In this program,user  ask to enter an alphabet to check whether it is a vowel or not, then display the result on the screen:

You may also like: