I'm trying to set the console background color to a random color but it always returns magenta. What would I have to change to fix this issue. Thanks!
using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Random random = new Random();
int randomInt = random.Next(0, 6);
while(randomInt < 7)
{
Console.BackgroundColor = ConsoleColor.Red;
randomInt++;
Console.BackgroundColor = ConsoleColor.Blue;
randomInt++;
Console.BackgroundColor = ConsoleColor.Cyan;
randomInt++;
Console.BackgroundColor = ConsoleColor.Green;
randomInt++;
Console.BackgroundColor = ConsoleColor.Red;
randomInt++;
Console.BackgroundColor = ConsoleColor.Yellow;
randomInt++;
Console.BackgroundColor = ConsoleColor.Magenta;
randomInt++;
}
}
}
}