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();
}
}
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
Related Questions on Classes and Objects in C Sharp
A. A blueprint for creating objects
B. A method in C#
C. A variable in C#
D. A data type in C#
A. A method in C#
B. A variable in C#
C. An instance of a class
D. A data type in C#
A. public
B. private
C. protected
D. internal

Join The Discussion