Consider this program:
public class CountStuff
{
public static void doSomething()
{
int count = 0;
...
//code to do something - no screen output produced
count++;
}
public static void Main(String[] args)
{
int count = 0;
Console.Write("How many iterations?");
int n = Convert.ToInt32(Console.ReadLine()); //read user input
for (int i = 1; i <= n; i++)
{
doSomething();
Console.Write(count);
}
}
}
If the input value for n is 3, what screen output will this program subsequently produce?
(A) 0
0
0
(B) 1
2
3
(C) 3
3
3
(D) ?
?
?
where ? is some undefined value.
(E) No output will be produced.