Examveda

What will be the output of the following C# code?
class number
{
    int length = 50;
    public int number1
    {
        get
        {
            return length;
        }
        set
        {
            length = value;
        }
    }
}
class Program
{
    public static void Main(string[] args)
    {
        number p = new number();
        p.number1 = p.number1 + 40;
        int k = p.number1 * 3 / 9;
        Console.WriteLine(k);
        Console.ReadLine();
    }
}

B. 180

C. 30

D. Compile time error

Answer: Option C


Join The Discussion

Related Questions on Exception Handling in C Sharp