Write a program to count the number of vowels in a string “Informatics Practices” ?
Share
Write a program to count the number of vowels in a string “Informatics Practices” ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Verified answer
Required Answer:-
Question:
Solution:
Here is the program. This is written in Python.
s="Informatics Practices"
c=0
for i in range(len(s)):
if s[i] in "aeiouAEIOU":
c+=1
print("Number of vowels: ",c)
Explanation:
Output is attached.
Program
count = 0
for letter in "Informatics Practices".lower( ):
if letter in "aeiou":
count += 1
print("Total number of vowels -", count)
Algorithm