What will be the output of the following C# code? [code] static void Main(string[] args) { int I, J = 0; for (I = 1; I < 10;

Vy Bùi

New member
What will be the output of the following C# code?
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.
Code:
 25
C. 1
D. Run time error
 

Tìm kiếm

Back
Top