ExamVeda
Login
Home
Exception Handling in C Sharp
?

What will be the output of the following C# code?
class number
{
    private int num1 = 60;
    private int num2 = 20;
    public int anumber
    {
        get
        {
            return num1;
        }
        set
        {
            num1 = value;
        }
    }
    public int anumber1
    {
        get
        {
            return num2;
        }
        set
        {
            num2 = value;
        }
    }
}
class Program
{
    public static void Main(string[] args)
    {
        number p = new number();
        number k = new number();
        int m = p.anumber;
        int t = k.anumber1;
        int r = p.anumber * k.anumber1;
        Console.WriteLine("sum = " + r);
        Console.ReadLine();
    }
}

Answer & Solution
Correct Answer: Option C
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.