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:
Post a Comment