Tuesday, September 6, 2011

program to check vowel or not

program to check vowel or not
import java.util.*;
class Sam
{
public static void main(String args[])
{
Scanner s=new Scanner(System.in);

System.out.println("Enter Char");

String s1=s.next();

char c=s1.charAt(0);

if( c=='a' || c=='e' || c=='i' || c=='o' || c=='u' || c=='A' || c=='E' || c=='I' ||c=='O' || c=='U' )
{
System.out.println("It is a Vowel");
}
else
{
System.out.println("Not a Vowel");
}
}
}

If U LIKE THE POST FOLLOW THE BLOG

No comments:

Post a Comment