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

What will be the output of the following C# code? class maths { public int x; public double y; public int add(int a, int b) { x = a + b; return x; } public int add(double c, double d) { y = c + d; return (int)y; } public maths() { this.x = 0; this.y = 0; } } class Program { static void Main(string[] args) { maths obj = new maths(); int a = 4; double b = 3.5; obj.add(a, a); obj.add(b, b); Console.WriteLine(obj.x + " " + obj.y); Console.ReadLine(); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option D • 8, 7

Related Computer Questions

The return type of getElementsByClassName() is In Powerpoint 2016, 'Rehearse Timings' option is available in:_________? What is the worst case complexity of bubble sort? What will be the output of the following C# code? static void Main(string[] args) { String c = "Hello"; String a ; a = c.Replace('l', 'w'); Console.WriteLine(a); Console.ReadLine(); } What is the role of NiFi's "ListQueue" processor?