Skip to content

How do you calculate the number of vowels and consonants in a string? #1668

Answered by Emojees
Kuefo asked this question in Q&A
Discussion options

You must be logged in to vote

Using For Loops
Take the string as input
Take each character from this string to check
If this character is a vowel, increment the count of vowels
Else increment the count of consonants.
Print the total count of vowels and consonants in the end.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kuefo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants