adplus-dvertising
frame-decoration

Question

Select the output for the following set of code:
static void Main(string[] args)
 {
     int I, X;
     for (I = 1; I <= (9 % 2 + I); I++)
     {
         X = (I * 3 + I * 2) / I;
         Console.WriteLine(X);
     }
     Console.ReadLine();
 }

a.

Output of code is 5 10

b.

Output is 5 5 5 5

c.

Print 5 infinite times

d.

None of the mentioned

Posted under C# programming

Answer: (c).Print 5 infinite times

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: