Skip to content

Instantly share code, notes, and snippets.

@jesuscmadrigal
Created October 28, 2017 16:16
Show Gist options
  • Save jesuscmadrigal/e8a9be28848eb642aa526965c0408a41 to your computer and use it in GitHub Desktop.
Save jesuscmadrigal/e8a9be28848eb642aa526965c0408a41 to your computer and use it in GitHub Desktop.
#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