adplus-dvertising
frame-decoration

Question

Select output for the following set of code:
static void Main(string[] args)
 {
     int I, J = 0;
     for (I = 1; I < 10; ) ;
     {
         J = J + I;
         I += 2;
     }
     Console.WriteLine("Sum of first 10 even numbers is:"+J);
     Console.ReadLine();
 }

a.

1 2 3 4 5 6 7 8 9

b.

25

c.

1

d.

Run time error

Posted under C# programming

Answer: (d).Run 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: