Pages

Wednesday, April 23, 2025

Check how many lowercase vowels occured in C++

 #include <iostream>

#include <cstring>





int main()

{


#include <iostream>

using namespace std;


bool isVowel(char ch) {

    return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u';

}


void countLowercaseVowels(string word) {

    int vowelCount = 0;


    for (char ch : word) {

        if (isVowel(ch)) {

            vowelCount++;

        }

    }


    cout << "Number of lowercase vowels in \"" << word << "\": " << vowelCount << endl;

}


int main() {

    string input;

    cout << "Enter a word: ";

    cin >> input;


    countLowercaseVowels(input);


    return 0;

}


return 0;

}

No comments:

Post a Comment

how to become red on codeforces by Errichto Algorithms | explained simply in a blog

 Yes. I found an available transcript of the video and summarized it simply. The video is “How To Become Red Coder? (codeforces.com)” by Err...