Examveda

What will be the output of the following C# 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

Answer: Option D


Join The Discussion

Related Questions on Arrays and Strings in C Sharp