#pragma argsused
#include
#include
#include
void main ()
{
char kalimat[100];
int i, kapital=0, kecil=0,
spasi=0, tbaca = 0, ;
clrscr;
cout<<"Masukkan kalimat : "<
cin.getline(kalimat,sizeof(kalimat));
for (i=0;kalimat[i];i++)
{
if (islower (kalimat[i]))kecil++;
if (isupper (kalimat[i]))kapital++;
if (ispunct (kalimat[i]))tbaca++;
if (isspace (kalimat[i]))spasi++;
}
cout<<"Jumlah huruf kapital : "<<
cout<<"Jumlah huruf kecil : "<<
cout<<"Jumlah tanda baca : "<<
cout<<"Jumlah spasi : "<<
getch();
}
Home »Unlabelled » Contoh program ( Fungsi String )
Contoh program ( Fungsi String )
Posted by
Adhit
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment