Answer to Question #204940 in C for Ali khan

Question #204940

Write a program to count the number of occurrences of any two vowels in succession 

in a line of text. For example, in the sentence 

“Pleases read this application and give me gratuity” such occurrences are ea, ea, ui.


1
Expert's answer
2021-06-10T05:57:53-0400
def IsVowel(ch):
    return (ch.lower() in ['a', 'e', 'i', 'o', 'u'])

source = input()
count = 0
for i in range(0, len(source) - 1):
    if IsVowel(source[i]) and IsVowel(source[i+1]):
        count += 1
print('The number of occurrences of any two vowels in succession is', count)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS