Finding Vowel,Consonant and Other

Discuss Computer Science and Programming related problems

Moderators:Labib, bristy1588

User avatar
rakeen
Posts:384
Joined:Thu Dec 09, 2010 5:21 pm
Location:Dhaka
Finding Vowel,Consonant and Other

Unread post by rakeen » Mon Nov 12, 2012 12:25 pm

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.
r@k€€/|/

User avatar
leonardo shawon
Posts:169
Joined:Sat Jan 01, 2011 4:59 pm
Location:Dhaka

Re: Finding Vowel,Consonant and Other

Unread post by leonardo shawon » Sun Jan 13, 2013 12:34 am

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.
Ibtehaz Shawon
BRAC University.

long way to go .....

User avatar
Phlembac Adib Hasan
Posts:1016
Joined:Tue Nov 22, 2011 7:49 pm
Location:127.0.0.1
Contact:

Re: Finding Vowel,Consonant and Other

Unread post by Phlembac Adib Hasan » Sun Jan 13, 2013 1:47 pm

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...)
Welcome to BdMO Online Forum. Check out Forum Guides & Rules

Post Reply