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 22, 2015



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

                        || coll == n + n / 2 || coll == 3 * n - n / 2 - 1 || row == 1 && coll >= 2 * n - n / 2 + 1 && coll <= 3 * n + n / 2 - 2 || coll == 2 * n - n / 2 + 1 && row <= 3 || coll == 4 * n - n / 2 - 2 && row <= 3 || coll == 4 * n - n / 2 || coll == 5 * n - n / 2 || row == n / 2 + 1 && coll >= 4 * n - n / 2 && coll <= 5 * n - n / 2

                        || coll == n * 5 || coll == n * 5 + n / 2 || row == n && coll >= n * 5 + n / 2 && coll <= n * 6 + 2 || coll == n * 6 + 2 && row >= n - 2 || coll == n * 6 + n / 2

                        || (row == 1 || row == n / 2 + 1 || row == n) && coll >= n * 6 + n / 2 && coll <= n * 7 + 1

                        || coll == n * 7 + n / 2 && row > 1 && row < n && row > n / 2 + 2 || row < n / 2 + 1 && coll == n * 7 + n / 2 && row > 2 || (row == 1 || row == n / 2 + 1 || row == n) && coll >= n * 8 - n / 2 + 1 && coll < n * 8

                        || coll == n * 8 + n / 2 - 2 && (row < n && row > n / 2 + 2 || row > 2 && row <= n / 2) || row == 2 && coll == n * 8 - n / 2 || row == 2 && coll == n * 8 + 1

                        || row == n / 2 + 2 && coll == n * 8 + 1 || row == n && coll == n * 8 + 1

                        || coll == n * 8 + n / 2 + 1 || coll == n * 9 + n / 2 || row == n / 2 + 1 && coll > n * 8 + n / 2 + 1 && coll < n * 9 + n / 2)

                    {
                        Console.Write("*");
                    }

                    else
                    {
                        Console.Write(" ");
                    }
                }
                Console.WriteLine();
            }
            Console.ReadLine();
        }
    }

No comments: