Home »
MCQs »
C# MCQs
What will be the output of the following C# code? | Question 11
45. What will be the output of the following C# code?
using System;
class Program {
public static void Main() {
int i = 10;
Console.WriteLine(i++);
}
}
- 10
- 11
- 12
- Error
Answer: A) 10
Explanation:
The statement i++ is a post-increment operation, and it increases the value of i after evaluating the Console.WriteLine() statement. Thus, 10 will be printed.