3:11 pm - Wednesday November 23, 6467

Java Example Program for given character vowel or not

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**

*@author:Sureshbabu
*@description:java example program for given charcter is vowel or not

*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Vowel {
public static void main(String args[]) throws IOException {
char n;
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter character");
n = r.readLine().charAt(0); // Read The Character

if (n == 'a' || n == 'A' || n == 'e' || n == 'E' || n == 'i'
|| n == 'I' || n == 'o' || n == 'O' || n == 'u' || n == 'U') {
System.out.println("Vowel");
} else {
System.out.println("not vowel");
}
}
}

output:

Enter character
 U
not vowel

Enter character
U
Vowel

Filed in: Z-A All Java Codes

Comments are closed.