loading...

re: Challenge: Write a program that never stops VIEW POST

FULL DISCUSSION
 

C#

class Program
{
   public static IEnumerable<string> HelloWorld()
   {
      while(true) yield return Hello World;
   }
   public static void Main(string[] args)
   {
      foreach (string  s in HelloWorld())
      {
         Console.WriteLine(s);
         Thread.Sleep(1000);
      }
   }
}
code of conduct - report abuse