package nameyu;import java.util.Scanner;public class Test { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner input=new Scanner(System.in); System.out.print("Enter a letter:"); String str=input.nextLine(); char ch=str.charAt(0); if(ch=='A'||ch=='a'){ System.out.println(ch+" is a vowel"); } else if(ch=='E'||ch=='e'){ System.out.println(ch+" is a vowel"); } else if(ch=='I'||ch=='i'){ System.out.println(ch+" is a vowel"); } else if(ch=='O'||ch=='o'){ System.out.println(ch+" is a vowel"); } else if(ch=='U'||ch=='u'){ System.out.println(ch+" is a vowel"); } else System.out.println(ch+" is a consonant"); } }
|