SHARE
TWEET

Untitled

a guest Oct 18th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace vowelsCount
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string word = Console.ReadLine().ToLower();
  10.             Console.WriteLine(GetCountOfVowels(word));
  11.         }
  12.  
  13.         static int GetCountOfVowels(string word)
  14.         {
  15.             int count = 0;
  16.             for (int i = 0; i < word.Length; i++)
  17.             {
  18.                 if(word[i] == 'a' || word[i] == 'e' || word[i] == 'i' || word[i] == 'o' || word[i] == 'u')
  19.                 {
  20.                     count++;
  21.                 }
  22.             }
  23.             return count;
  24.         }
  25.     }
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top