What Will Be The Output Of The Following C Codep Pre Langcsharp #381
What will be the output of the following C# code?</p> <pre><code class="language-csharp" line="1"> class maths { public int fun(int ii) { return(ii > 0 ? ii :ii * -1); } public long fun(long ll) { return(ll > 0 ? ll :ll * -1); } public double fun( double dd) { return(dd > 0 ? dd :dd * -1); } } class Program { static void Main(string[] args) { maths obj = new maths(); int i = -25; int j ; long l = -100000l ; long m; double d = -12.34; double e; j = obj.fun(i); m = obj.fun(l); e = obj.fun(d); Console.WriteLine(j + " " + m + " " + e); 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.