ExamVeda
Login
Home
Classes and Objects in C Sharp
?

What will be the output of the following C# code?
interface calc
{
    void cal(int i);
}
public  class maths :calc 
{
    public int x;
    public void cal(int i) 
    {
        x = i * i;            
    }
}
class Program
{
    public static void Main(string[] args)
    {            
        display arr = new display();
        arr.x = 0;      
        arr.cal(2);
        Console.WriteLine(arr.x);
        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.