Page 1 of 1

Finding Vowel,Consonant and Other

Posted: Mon Nov 12, 2012 12:25 pm
by rakeen
Write a program that will take a character from user and will print if it is vowel,consonant or 'other'(i.e 1,3,null). Use switch case And if-else.

Re: Finding Vowel,Consonant and Other

Posted: Sun Jan 13, 2013 12:34 am
by leonardo shawon
IN JAVA: how about using the ASCII value of all the vowels. rest are consonants. and those which are not string will be declared as others.

Re: Finding Vowel,Consonant and Other

Posted: Sun Jan 13, 2013 1:47 pm
by Phlembac Adib Hasan
The same technique can be used in C/C++. But if you want something 'complex' create an array of vowels. Now compare user's input letter with these. This technique can be used in any programming language that supports variables and if...else statement. (Like C/C++, Java, JavaScript, php, Python, Ruby...)