Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #include <iostream>
- using namespace std;
- int main(){
- char s[256];
- int i=0;
- int jmlA=0, jmlI=0,
- jmlE=0, jmlU=0,
- jmlO=0;
- cout << "Masukkan nama :" << endl;
- gets(s);
- strlen(s);
- while(i!=strlen(s)){
- if(s[i]=='a') jmlA++;
- else if(s[i]=='i') jmlI++;
- else if(s[i]=='u') jmlU++;
- else if(s[i]=='e') jmlE++;
- else if(s[i]=='o') jmlO++;
- i++;
- }
- cout << "Jumlah Huruf A: " << jmlA<<endl;
- cout << "Jumlah Huruf I: " << jmlI<<endl;
- cout << "Jumlah Huruf E: " << jmlE<<endl;
- cout << "Jumlah Huruf U: " << jmlU<<endl;
- cout << "Jumlah Huruf O: " << jmlO<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement