Let's test your knowledge. Click the correct answer from the options.
What is the output of the following code?
TEXT/X-CSHARP
1for (int i = 1; i <= 10; i++)
2{
3 if (i % 2 == 0)
4 {
5 Console.WriteLine(i);
6 }
7}
- 1, 3, 5, 7, 9
- 2, 4, 6, 8, 10
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- None of the above