0
How to count consonants after vowel in a string but not after a consonant
Ex:Ooprtuh No.of consonants=2
5 Respostas
+ 1
Which is it, c, c++, or Java?
+ 1
In general:
Make a list of vowels and a list of consonants.
Loop through the letters of your string.
If a letter is in the list of consonants check if the letter before is in the list of vowels, if it is increase the count.
+ 1
You can use ASCII values with loop as well...Here is an example for you
https://code.sololearn.com/c7aaxB8xDXWX/?ref=app
Hope it helps :)
0
U can define vowel in array if u dont want to write then u need to write big expression in if else condition . u need to check if entered char is match with vowel or not if not then in else part you can use one counter variable which will count the number of iterations.
Logic is simple u can take string as a input and store in char array then check index 0 is vowel or not and use counter do same for all or u can also count all the vowels and subtract with the
total lenght of string - total number of vowela remaining are consonent
0
Yamuna Murari,
I have the code ready, but I'll be waiting for you to give it a try first, and share your code link here.