What will be the output of the following C# code?

static void Main(string[] args)
 {
     int i= 0,k;
     label: Console.WriteLine(i);
     if (i == 0)
         goto label;
     Console.ReadLine();
 }

a) 0 0 0 0
b) 0 0 0
c) 0 infinite times
d) 0

1 thought on “What will be the output of the following C# code?”

  1. c
    Explanation: Since, if condition is always true. Loop will continue executing always without any end condition.
    Output:
    0 0 0….

Leave a Comment