ICSE Class 10 Computer Applications
Question 62 of 76
Revising Basic Java Concepts — Question 66
Back to all questions 66
Question Question 43
Write a program that inputs an alphabet and checks if the given alphabet is a vowel or not.
import java.util.Scanner;
public class KboatVowelCheck
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter a character: ");
char ch = in.next().charAt(0);
ch = Character.toUpperCase(ch);
if(ch == 'A' ||
ch == 'E' ||
ch == 'I' ||
ch == 'O' ||
ch == 'U')
System.out.println("Vowel");
else
System.out.println("Not a vowel");
}
}Output

