daily pastebin goal
56%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top