Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Enter your word here: ");
- string word = Console.ReadLine().ToLower();
- Console.WriteLine(VowelCounter(word));
- }
- static int VowelCounter(string word)
- {
- int counter = 0;
- foreach(char i in word)
- {
- if(i == 'a' || i == 'i' || i == 'o' || i == 'u' || i == 'e')
- {
- counter++;
- }
- }
- return counter;
- }
- }
- }
Add Comment
Please, Sign In to add comment