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

Thursday, June 18, 2015


class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter the number of row");
            int n = int.Parse(Console.ReadLine());
            for (int row = 0; row < n; row++)
            {
                for (int coll = 0; coll < (n * 4); coll++)
                {
                    if (coll <= row || (coll >= n && coll <= (n * 2) - (row + 1))

                    || (coll >= n * 2 && coll >= (n * 2) + row && coll < n * 3)

                    || (coll >= (n * 4) - (row + 1))

                    )

                    {
                        Console.Write("*");
                    }
                    else
                    {
                        Console.Write(" ");

                    }

                }
                Console.WriteLine();
            }

            Console.ReadLine();

        }

    }


No comments: