Meninjau Huruf Vokal & Konsonan c++

Posted: October 12, 2010 in Algoritma & Struktur Data
Tags:

#include
#include
#include
#include
void main()
{
int a,vokal=0,konsonan=0;
char nilai[40];

cout<<“Masukan kalimat : “;cin.getline(nilai, sizeof(nilai));
for(a=0;nilai[a];a++)
{
if(isalpha(nilai[a]))
{
if((nilai[a]==’a’)||(nilai[a]==’i’)||(nilai[a]==’u’)||(nilai[a]==’e’)||(nilai[a]==’o’)||(nilai[a]==’A’)||(nilai[a]==’I’)||(nilai[a]==’U’)||(nilai[a]==’E’)||(nilai[a]==’O’))
vokal++;
else
konsonan++;
}
}
cout<<“Total huruf vokal adalah =”<<vokal<<endl;
cout<<“Total huruf konsonan adalah =”<<konsonan<<endl;
cout<<endl;
cout<<endl;
cout<<“\t Created By “<<endl;
cout<> || <Kelompok  3> || <<- “<<endl;
cout<<“\t Algoritma & Struktur Data “;
getch();
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s