What will be the output of the following C# code snippet? [code] class test { public int a; public int b; public test(int

What will be the output of the following C# code snippet?
Code:
 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.
Code:
20, 10
D. 10, 20
 

Tìm kiếm

Back
Top