Subscribe Now: standard

Thursday, October 22, 2009

Create a C program that will input letters a-z. but only the consonants will be printed?


Aim: Create a C program that will input letters a-z. but only the consonants will be printed?
Type: Basic C++ , Array Manipulation.

Code:===============================================

#include

int main()
{

char al[26];
for(int i=0;i<26;i++)
{
cout<<"\nEnter alphabet... enter one and press enter : ";
cin>>al[i];
}

for(int i=0;i<26;i++)
{
if( (al[i]!='a')&&(al[i]!='e')&&(al[i]!='i')&&(al[i]!='o')&&(al[i]!='u'));
{
cout<<<" ";
}
}
return 0;
}

==================================================

I wrote it for someone who asked for it in yahoo answers.
for any help , just contact me.
http://www.blaisemcrowly.co.cc use the CONTACT ME page
or mail me at blaise.crowly@gmail.com

No comments:

Post a Comment