What will be the output of the following C# code?
static void Main(string[] args)
{
int x = 0;
do
{
x++;
if (x == 5)
{
x++;
continue;
break;
}
Console.WriteLine(x + " ");
}
}while (x < 10);
static void Main(string[] args)
{
int x = 0;
do
{
x++;
if (x == 5)
{
x++;
continue;
break;
}
Console.WriteLine(x + " ");
}
}while (x < 10);A. 1 2 3 4 5
B. 10
C. 5 6 7 8 9 10
D. 1 2 3 4 5 6 7 8 9 10
Answer: Option D

Join The Discussion