Guest User

Untitled

a guest
Jan 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int count = 0;
  8. char letter = 0;
  9.  
  10. cout << "Enter a sentence: ";
  11.  
  12. while (letter != '\n')
  13. {
  14. cin.get(letter);
  15. switch(toupper(letter))
  16. {
  17. case 'A':
  18. case 'E':
  19. case 'I':
  20. case 'O':
  21. case 'U':
  22. cout << letter << ", ";
  23. count++;
  24. }
  25. }
  26.  
  27. cout << endl << endl;
  28. cout << "There are " << count << " vowels in this sentence." << endl << endl;
  29.  
  30. return 0;
  31.  
  32. }
Add Comment
Please, Sign In to add comment