Wlcome to the blogging tifani

Program C++ Menghitung Jumlah Hurup Vokal dan Hurup Konsonan

Selasa, 21 Oktober 20141komentar

#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
using namespace std;
int main()

{
char kalimat[1000];
                int x,vokal,konsonan,y;
                x=0;
                vokal=0;
                konsonan=0;
                cout<<"\t\t===---------------------------------------------==="<<endl;
                cout<<"\t\t|MENGHITUNG JUMLAH HURUP VOKAL DAN HURUP KONSONAN |"<<endl;
                cout<<"\t\t===---------------------------------------------==="<<endl;
                cout<<"input kalimat :";
                cin.getline(kalimat,100);
                y=strlen(kalimat);
                for(x=0;x<y;x++)
                                {if (kalimat[x]=='a'||kalimat[x]=='i'||kalimat[x]=='u'||kalimat[x]=='e'||kalimat[x]=='o')
                                                vokal++;
                                if (kalimat[x]!='a'||kalimat[x]!='i'||kalimat[x]!='u'||kalimat[x]!='e'||kalimat[x]=='o')
                                                konsonan++;}
                               
                                system ("cls");
                                cout<<"\t\t\t===----------------==="<<endl;
                                cout<<"\t\t\t\t|HASIL|"<<endl;
                                cout<<"\t\t\t===----------------==="<<endl;
                                cout<<"isi kalimat : "<<kalimat<<endl;
                                cout<<"jumlah hurup vokal :"<<vokal<<endl;
                                cout<<"jumlah hurup konsonan : "<<konsonan;
                                getch();
}


Share this article :

+ komentar + 1 komentar

21 Oktober 2014 pukul 05.11

kekurangan dari program ini, jika dia pake hurup kapital maka dia gak bakalan dihitung

Posting Komentar

 
Support : Cara Gampang | Creating Website | Johny Template | Mas Templatea | Pusat Promosi
Copyright © 2015. TIfanie - All Rights Reserved
Template edited by Creating Website Modify by Teknologi Informasi kinie
Proudly powered by Blogger