Vidyalelo
C# Programming · Q47

Arrays and Strings in C Sharp

Programming · C# Programming · question 47

Q47

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

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

Answer: Option C

Solution

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