What will be the output of the following C# code? static void Main(string[] args)
View Question
Select the output for the following set of code :
static void Main(string[] args)
{
int a = 0;
int i = 0;
int b;
for (i = 0; i < 5; i++)
{
a++;
Console.WriteLine(“Hello \n”);
continue;
}
Console.ReadLine();
}
Select the output for the following set of code : static void Main(string[] args)
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 0;
int j = 0;
for (i = 0; i < 4; i++)
{
for (j = 0; j < 3; j++)
{
if (i > 1)
continue;
Console.WriteLine(“Hi \n”);
}
}
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
int i= 0,k;
label: Console.WriteLine(i);
if (i == 0)
goto label;
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 0, j = 0;
l1: while (i < 2)
{
i++;
while (j < 3)
{
Console.WriteLine(“loop\n”);
goto l1;
}
}
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 0;
if (i == 0)
{
goto label;
}
label: Console.WriteLine(“HI…”);
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 0, j = 0;
while (i < 2)
{
l1: i–;
while (j < 2)
{
Console.WriteLine(“hi\n”);
goto l1;
}
}
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
int i = 10 , j = 0;
label:
i–;
if ( i > 0)
{
Console.WriteLine(i+ ” “);
goto label;
}
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
int i;
Console.WriteLine(“enter value of i:”);
i = Convert.ToInt32(Console.ReadLine());
if ( i % 2 == 0)
goto even:
else
{
Console.WriteLine(“number is odd:”);
Console.ReadLine();
}
even:
Console.WriteLine(“number is even:”);
Console.ReadLine();
}
for i = 4.
What will be the output of the following C# code? static void Main(string[] args) { ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
int i;
Console.WriteLine(“enter value of i:”);
i = Convert.ToInt32(Console.ReadLine());
if (i < 7)
{
i++;
continue;
}
Console.WriteLine(“final value of i:” +i);
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) ...
View Question