adplus-dvertising
frame-decoration

Question

Select the 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.

number is odd

b.

number is even

c.

Compile time error

d.

none of the mentioned

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 the output for the following set of Code :