Finding Number of Vowels, Consonants & Words
Initialise vowel and consonant count with 0.
Initialise word count with 1 as there will be a minimum of 1 word in each string.
Use a for loop to check all characters.
If it is an uppercase or lowercase vowels, increment vowel count.
If not, check if the character lies in the uppercase and lowercase alphabet range. If so, increment consonant count.
If not, check if the character is a space. If so, increment word count.
Contributed by Nitin Ranganath
Last updated