using System;using System.Threading;class Program{ static void Main() { string text = "Hello World!"; while (true) { Console.SetCursorPosition(0, Console.CursorTop); Console.ForegroundColor = GetRandomConsoleColor(); Console.Write(text); Thread.Sleep(1000); } } static ConsoleColor GetRandomConsoleColor() { var consoleColors = Enum.GetValues(typeof(ConsoleColor)); return (ConsoleColor)consoleColors.GetValue(new Random().Next(consoleColors.Length)); }}