Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

alphabet n vowelin java

import java.util.Scanner;
public class VowelOrConsonant {
   public static void main(String args[]){
      System.out.println("Enter a character :");
      Scanner sc = new Scanner(System.in);
      char ch = sc.next().charAt(0);
      if(ch == 'a'|| ch == 'e'|| ch == 'i' ||ch == 'o' ||ch == 'u'||ch == ' '){
         System.out.println("Given character is an vowel");
      }else{
         System.out.println("Given character is a consonant");
      }
   }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #alphabet #vowelin #java
ADD COMMENT
Topic
Name
6+4 =