Advertisement
Qrist

Vowels Count

Apr 14th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main(string[] args)
  5.     {
  6.         string vow = Console.ReadLine().ToLower();
  7.         GetVowels(vow);
  8.     }
  9.     public static void GetVowels(string st)
  10.     {
  11.         int count = 0;
  12.         for (int i = 0; i < st.Length; i++)
  13.         {
  14.             if(st[i]=='a'|| st[i]=='e'|| st[i]=='i' || st[i]=='o'|| st[i]=='u')
  15.             {
  16.                 count++;
  17.             }
  18.         }
  19.         Console.WriteLine(count);
  20.        
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement