Infinite for Loop - CSharp Language Basics

CSharp examples for Language Basics:for

Description

Infinite for Loop

Demo Code

using System;/*  w ww.j  av a2s  .  c  o m*/
class Program {
   static void Main(string[] args) {
      for (; ; ) {
         Console.WriteLine("Hey! I am Trapped");
         break;//comment out to produce the infinite for loop
      }
   }
}

Result


Related Tutorials