adplus-dvertising
frame-decoration

Question

Select output for the following set of code :
static void Main(string[] args)
 {
     int i;
     Console.WriteLine("enter value of i:");
     i = Convert.ToInt32(Console.ReadLine());
     if ( i % 2 == 0)
         goto even:
     else
     {
         Console.WriteLine("number is odd:");
         Console.ReadLine();
     }
     even:
     Console.WriteLine("number is even:");
     Console.ReadLine();
 }
for i = 4.

a.

12

b.

11

c.

Compile time error

d.

13

Posted under C# programming

Answer: (c).Compile time error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Select output for the following set of code :