Search This Blog

Wednesday, 11 September 2013

Finding Vowels of String

Vowels in a Entered String

using System;

class Vowel
{
  public static void Main(String[] args)
  {
    string st;
    int count=0;
    Console.WriteLine("Enter String:");
    st=Convert.ToString(Console.ReadLine());
    Console.WriteLine("String is:"+st);
    Console.WriteLine("Length is:"+st.Length);
    for(int i=0;i<st.Length;i++)
    {
    Console.WriteLine(st[i]);
    Console.Beep();
    }
    for(int i=0;i<st.Length;i++)
    {
      if(st[i]=='a'||st[i]=='e'||st[i]=='i'||st[i]=='o'||st[i]=='u')
      {
        count++;
      }
    }
    Console.WriteLine("number of vowel is:"+count); 
   
    Console.ReadLine();
  }
}

Output

No comments:

Popular Posts