1)

Select the output for the given set of programming code:

class Program
{
static void Main(string[] args)
{
int i;
for ( i = 0; i < 3; i++)
{

}
Console. WriteLine(i);
Console. ReadLine();
}
}


A) 0,1, 2, 3

B) 0, 1, 2

C) 2

D) 3

Answer:

Option D

Explanation:

Since final console statement is outside forloop. So, result will be printed in final values only.