Created
October 28, 2017 16:16
-
-
Save jesuscmadrigal/e8a9be28848eb642aa526965c0408a41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using std::cin; | |
using std::cout; | |
using std::endl; | |
int main(){ | |
char phrase[100]; | |
int vocala=0; | |
cout<< "Write a phrase" << endl; | |
cin.getline(phrase,100); | |
cout << "which letter do you want to count? " << endl; | |
char a=0; | |
cin >> a; | |
for (int i=0;i<100;i++) | |
{ | |
if(phrase[i] == a) | |
{ | |
vocala=vocala++ + 1; | |
} | |
} | |
cout << "the numbers of letters " << a << " in this phrase is: " << vocala << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment