We are providing online training of realtime Live project on Asp.Net MVC with Angular and Web API. For more information click here. If you have any query then drop the messase in CONTACT FORM

Monday, June 15, 2015

Write a program input a string and remove the bowel in the string.

class Program
    {
        static void Main(string[] args)
        {

            Console.WriteLine("Enter a string");
            string str = Console.ReadLine();
            char[] ch = { 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U' };
            string str1 = "";

            bool flag = false;
            for (int i = 0; i < str.Length; i++)
            {

                for (int j = 0; j < ch.Length; j++)
                {

                    if (str[i] == ch[j])
                    {

                        flag = true;
                        break;
                    }
                    else

                        flag = false;
                }

                if (!flag)
                {

                    str1 += str[i];
                }
                              
            }

            Console.WriteLine(str1);

            Console.ReadLine();

        }
    }



OUTPUT:

No comments: