Friday, June 27, 2014

TO TAKE ANY CHARACTER AS INPUT & DETERMINE THAT CHARACTER IS VOWELS OR CONSONANT

public class vowel {
    public static void main(String[] args) throws IOException
    {
        char c;
        int n;
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(in);

        System.out.println("Enter Character : ");
        c=(char)br.read();
        System.out.println("Ur Input values : "+c);

        switch(c)
        {
            case 'A':
            case 'a' :System.out.println("Its vowel A"); break;

            case 'E':
            case 'e':System.out.println("Its vowel E"); break;

            case 'I':
            case 'i':System.out.println("Its vowel I"); break;

            case 'O':
            case 'o':System.out.println("Its vowel O"); break;

            case 'U':
            case 'u':System.out.println("Its vowel U"); break;
            default:System.out.println("Consonant");
        }
        }
}

No comments:

Post a Comment

JAC Board Computer || IIT 2025 || Introductory Information Technology || Class 10 || Practical Examination 2025

Marks Division HOE 30 Marks IT Application Report File 20 Marks Viva - Voce 10 Marks 1) Write an HTML code to generate a web p...