B
Q. What will be the output of the following C# code?
Code:
class Program
{
static void Main(string[] args)
{
int i ;
for ( i = 0; i < 5; i++)
{
int j = 0;
j += i;
Console. WriteLine(j);
}
Console. WriteLine(i);
Console. ReadLine();
}
}
{
static void Main(string[] args)
{
int i ;
for ( i = 0; i < 5; i++)
{
int j = 0;
j += i;
Console. WriteLine(j);
}
Console. WriteLine(i);
Console. ReadLine();
}
}
- Correct Answer - Option(B)
- Views: 145
- Filed under category C#
Discusssion
Login to discuss.