Vidyalelo
C# Programming · Q84

Basic Syntax and Data Types in C Sharp

Programming · C# Programming · question 84

Q84

What will be the output of the following C# 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();

A.
0, 1, 2, 3, 4, 5, 6
B.
0, 1, 2, 3, 4, 5
Answer
C.
0, 1, 2, 3, 4
D.
0, 1, 2, 3

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board