Home / MCQ Bank / Computer
Computer Classes And Objects In C Sharp

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(); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • 25 1000

Related Computer Questions

The following C# code is run on single level of inheritance. What will be the Correct statement in the following C# code? class sample { int i = 10; int j = 20; public void display() { Console.WriteLine("base method "); } } class sample1 : sample { public int s = 30; } class Program { static void Main(string[] args) { sample1 obj = new sample1(); Console.WriteLine("{0}, {1}, {2}", obj.i, obj.j, obj.s); obj.display(); Console.ReadLine(); } } Which function is used to copy one string to another in C? Which function is useful when you want to output the executed command's result? Which of these class contains the methods print() & println()? Which statistical method is commonly used to test the stationarity of a time series data set?