ExamVeda
Login
Home
Classes and Objects in C Sharp
?

What will be the output of the following C# code?
class maths
{
    public int fun1(int k)
    {
        k = 20;
        return k;
    }
    public Single fun1(float t)
    {
        t = 3.4f;
        return t;
    }
}  
class Program
{
    static void Main(string[] args)
    {
        maths obj = new maths();
        int i;
        i = obj.fun1(30);
        Console.WriteLine(i);
        Single j;
        j = obj.fun1(2.5f);
        Console.WriteLine(j);
        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.