Vidyalelo
C# Programming · Q152

Miscellaneous in C Sharp

Programming · C# Programming · question 152

Q152

What will be the output of the following C# code snippet? class test public int a; public int b; public test(int i, int j) a = i; b = j; public void meth(test o) o.a *= 2; o.b /= 2; class Program static void Main(string[] args) test obj = new test(10, 20); obj.meth(obj); Console.WriteLine(obj.a + " " + obj.b); Console.ReadLine();

A.
20, 40
B.
40, 20
C.
20, 10
Answer
D.
10, 20

Answer: Option C

Solution

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