What will be the output of the following C# code? [code] static void Main(string[] args) { int i = 0; while (i <= 50)

Duyên Trương

New member
What will be the output of the following C# code?
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 doesn't print anything
D. Code generate error
 

Tìm kiếm

Back
Top