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


class Program
    {
        static void Main(string[] args)
        {
            for (int i = 1; i <= 29; i++)
            {
                if (i < 8)
                    for (int j = i; j <= 20; j++)
                    {

                        Console.Write(" ");
                    }

                if (i <= 8)
                    for (int j = 0; j < (i * 2 - 1); j++)
                    {
                        Console.Write("*");
                    }
                if (i > 8 & i < 15)
                {

                    for (int j = 8; j < i; j++)
                    {

                        Console.Write(" ");
                    }
                   
                }
               
                if (i >= 8)
                    for (int j = (15 * 2) - 2; j >= i * 2; j--)
                    {
                        Console.Write("*");
                    }
                if (i > 8 & i <= 14)
                {

                    for (int j = 5; j < (i * 2) + 4; j++)
                    {

                        Console.Write(" ");

                    }
                }

                if (i >= 8)
                    for (int j = (15 * 2) - 2; j >= i * 2; j--)
                    {
                        Console.Write("*");
                    }

                if (i >= 15)

                    for (int j = i; j <= 19; j++)
                    {

                        Console.Write(" ");
                    }
                if (i >= 15 & i < 22)
                {
                    for (int j = 15; j < i + 1; j++)
                    {
                        Console.Write("*");
                    }
                    for (int j = 15; j < i; j++)
                    {

                        Console.Write("*");
                    }
                }
                if (i >= 15 & i < 21)
                    for (int j = 26 * 2; j > i * 2 - 7; j--)
                    {
                        Console.Write(" ");
                    }
                if (i >= 15 & i < 22)
                {

                    for (int j = 15; j < i + 1; j++)
                    {
                        Console.Write("*");
                    }
                    for (int j = 15; j < i; j++)
                    {
                        Console.Write("*");
                    }
                }
                if (i > 20)
                {
                    if (i > 21)

                        for (int j = 9; j < i; j++)
                        {
                            Console.Write(" ");
                        }
                    for (int j = 27 * 2; j > (i * 2 - 5); j--)
                    {
                        
                        Console.Write("*");
                    }
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }

    }


}

No comments: