Examveda

What will be the output of the following C# code?
class maths
{
    public int fun(int k, int y, int n)
    {
        Console.WriteLine(k + "  " + y + "  " + n);
        return (k);
    }
    public int fun1(int t,float z)
    {
        Console.WriteLine(t + "  " + z);
        return t;
    }
}    
class Program
{
    static void Main(string[] args)
    {
        maths obj = new maths();
        int b = 90;
        int c = 100;
        int d ;
        float l;
        int i = obj.fun(b, c, 12);
        int j = (obj.fun1(12, 14.78f));
        Console.ReadLine();
    }
}

A. 0, 0, 0
12, 14.78

B. 0, 0, 0
0, 0

C. 90, 100, 12
12, 14

D. 90, 100, 12
12, 14.78

Answer: Option D


Join The Discussion

Related Questions on Classes and Objects in C Sharp