What will be the output of the following C# code?
int a,b;
a = (b = 10) + 5;
int a,b;
a = (b = 10) + 5;
A. b = 10, a = 5
B. b = 15, a = 5
C. a = 15, b = 10
D. a = 10, b = 10
Answer: Option C
int a,b;
a = (b = 10) + 5;
A. b = 10, a = 5
B. b = 15, a = 5
C. a = 15, b = 10
D. a = 10, b = 10
Answer: Option C
What is the correct syntax to declare a variable in C#?
A. num = int;
B. var num;
C. num int;
D. int num;
What is the purpose of the 'var' keyword in C#?
A. Declares a constant
B. Converts a variable to string
C. Implicitly declares a variable
D. Defines a method
Join The Discussion