adplus-dvertising
frame-decoration

Question

Select the output for the following set of code :
static void Main(string[] args)
 {
     int i = -10;
     for ( ;Convert.ToBoolean(Convert.ToInt32(i)) ;Console.WriteLine(i++)) ;
     Console.ReadLine();
 }

a.

-9 -8 -7 -6 -5 -4 -3 -2 -1

b.

-10 -9 -8 -7 -6 -5 -4 -3 -2

c.

-10 -9 -8 -7 -6 -5 -4 -3 -2 -1

d.

-8 -7 -6 -5 -4 -3 -2 -1

Answer: (c).-10 -9 -8 -7 -6 -5 -4 -3 -2 -1

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 :