adplus-dvertising
frame-decoration

Question

Select the output for the following set of code :
static void Main(string[] args)
 {
     int i = 0;
     while (i <= 50)
     {
         if (i % 10 == 0)
         continue;
         else
         break;
         i += 10;
         Console.WriteLine(i % 10);
    }
}

a.

code prints output as 0 0 0 0 0

b.

code prints output as 10 20 30 40 50

c.

infinite loop but donot print anything

d.

Code generate error

Answer: (c).infinite loop but donot print anything

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 :