Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char input{};
- unsigned short vowels{ 0 }, consonants{ 0 };
- cout << "Vowel Countern";
- do
- {
- cout << "Enter any letter(Q or q to terminate): ";
- cin >> input;
- switch (input)
- {
- case 'a':
- vowels += 1;
- break;
- case 'e':
- vowels += 1;
- break;
- case 'i':
- vowels += 1;
- break;
- case 'o':
- vowels += 1;
- break;
- case 'u':
- vowels += 1;
- break;
- default:
- consonants += 1;
- break;
- }
- } while ((input != 'q') || (input != 'Q'));
- cout << "Vowels entered: " << vowels << "nConsonants entered: " << consonants << endl;
- return 0;
Add Comment
Please, Sign In to add comment