Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace vowelsCount
- {
- class Program
- {
- static void Main(string[] args)
- {
- string word = Console.ReadLine().ToLower();
- Console.WriteLine(GetCountOfVowels(word));
- }
- static int GetCountOfVowels(string word)
- {
- int count = 0;
- for (int i = 0; i < word.Length; i++)
- {
- if(word[i] == 'a' || word[i] == 'e' || word[i] == 'i' || word[i] == 'o' || word[i] == 'u')
- {
- count++;
- }
- }
- return count;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement