RENCANA KULIAH=> MENCARI HURUF PADA KALIMAT

1.) C++
#include <iostream>


using namespace std;
int main()
{
  int a,x;
  int y=0,b=0,MAKS = 256;
  char kata[MAKS],huruf[MAKS];

  cout<<"masukkan kata atau kalimat = ";
      cin.getline( kata, MAKS );
      cout<<"masukkan huruf yang akan di cari jumlahnya = ";
      cin>>huruf;
  for ( x = 0 ; kata[x]; x++ ) {
    y++;
  }

  for ( a = 0 ; a<y; a++ ) {
        if (kata[a]==huruf[0] || kata[a]==huruf[0]+32 || kata[a]==huruf[0]-32)
        b++;
  }
    cout<<"jumlah huruf "<<huruf<<" = "<<b<<endl ;

  cin.get();
  cin.get();
}

Share this

Related Posts

Previous
Next Post »

1 komentar:

komentar
4 Maret 2022 pukul 15.40 delete

Casinos near Harrah's Philadelphia in Chester, PA - Mapyro
Casinos Near 목포 출장안마 Harrah's Philadelphia 화성 출장마사지 · 1. Harrah's Philadelphia, Chester, PA · 2. Harrah's 아산 출장샵 Philadelphia, 시흥 출장안마 PA · 3. 여수 출장마사지 Harrah's Philadelphia Casino

Reply
avatar