What Will Be The Output Of The Following C Codep Pre Langcsharp #401
What will be the output of the following C# code?</p> <pre><code class="language-csharp" line="1"> class maths { int i; public maths(int ii) { ii = -25; int g; g = ii > 0 ? ii : ii * -1; Console.WriteLine(g); } } class maths1 :maths { public maths1(int ll) :base(ll) { ll = -1000; Console.WriteLine((ll > 0 ? ll : ll * -1)); } } class Program { static void Main(string[] args) { maths1 p = new maths1(6); 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 - Constructor Overloading - Quiz No.1.
What will be the output of the following C# code?
class maths { int i; public maths(int ii) { ii = -25; int g; g = ii > 0 ? ii : ii * -1; Console.WriteLine(g); } } class maths1 :maths { public maths1(int ll) :base(ll) { ll = -1000; Console.WriteLine((ll > 0 ? ll : ll * -1)); } } class Program { static void Main(string[] args) { maths1 p = new maths1(6); Console.ReadLine(); } }
-25 -1000
-1000 -25
25 1000
None of the mentioned