What will be the output of the following C# code? [code] class sum { public int x; private int y; public void math(int

Trang Mắm

New member
What will be the output of the following C# code?
Code:
 class sum   
 {
     public int x;
     private int y;
     public void math(int a, int b)
     {
         x = a * 4;
         y = b;
     }
 }    
 class Program
 {
     static void Main(string[] args)
     {
         sum p = new sum();   
         p.math(12, 30);
         Console.WriteLine(p.x + "  " + p.y);
         Console.ReadLine();
     }
 }
A. 48, 30
B. 48, 0
C. 0, 0
D. Compile time error
 

Tìm kiếm

Back
Top