Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
    int i;
    for (i = 0;  ; )
    {
        Console.WriteLine("hello");
    }
    Console.ReadLine();
}

A. No output

B. hello

C. hello printed infinite times

D. Code will give error as expression syntax

Answer: Option C


Join The Discussion

Related Questions on Control Flow Statements in C Sharp