What Will Be The Output Of The Following C Codep Pre Langcsharp #380
What will be the output of the following C# code?</p> <pre><code class="language-csharp" line="1"> 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(); } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Object Oriented Concepts - Method Overloading - Quiz No.2.
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(); } }
0, 0, 0 12, 14.78
0, 0, 0 0, 0
90, 100, 12 12, 14
90, 100, 12 12, 14.78