ExamVeda
Login
Home
Arrays and Strings in C Sharp
?

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();
    }
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.