Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- int count = 0;
- char letter = 0;
- cout << "Enter a sentence: ";
- while (letter != '\n')
- {
- cin.get(letter);
- switch(toupper(letter))
- {
- case 'A':
- case 'E':
- case 'I':
- case 'O':
- case 'U':
- cout << letter << ", ";
- count++;
- }
- }
- cout << endl << endl;
- cout << "There are " << count << " vowels in this sentence." << endl << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment