forum

Home / DeveloperSection / Forums / Three colors repeated in C# Console application

Three colors repeated in C# Console application

Madam Walker177905-Oct-2013

I am new in C#.

Below is my code this code I have done so far:


for (int row = 1; row <= 25; row++)
        {
            for (int col = 1; col <= 39; col++)
            {
                switch (row)
                {
                    case 1:
                        Console.ForegroundColor = ConsoleColor.Red;
                        break;
                    case 2:
                        Console.ForegroundColor = ConsoleColor.White;
                        break;
                    case 3:
                        Console.ForegroundColor = ConsoleColor.Green;
                        break;
                }
                Console.Write("@ ");
        }
        Console.WriteLine();
}

In the above line of code, the first line is shows in red color after that all lines is shows in white color how can I achieve my task please anybody help me


All help is appreciated

Thanks


Updated on 05-Oct-2013

Can you answer this question?


Answer

1 Answers

Liked By