Home / MCQ Bank / Computer
Computer Miscellaneous In C Sharp Difficulty: Medium

What will be the output of the following C# code snippet? class sum { public int x; public int y; public int add (int a, int b) { x = a + b; y = x + b; return 0; } } class Program { static void Main(string[] args) { sum obj1 = new sum(); sum obj2 = new sum(); int a = 2; obj1.add(a, a + 1); obj2.add(5, a); Console.WriteLine(obj1.x + " " + obj2.y); Console.ReadLine(); } }

Select the correct option to test your answer:

More Computer Questions

What is the advantage of the multiplication method? What will happen in the following C++ code snippet? int a = 100, b = 200; int *p = &a, *q = &b; p = q; What will be the output of the following Python code? a=[10,23,56,[78]] b=list(a) a[3][0]=95 a[1]=34 print(b) What is the correct syntax to declare a structure with a tag name in C++? Which of the following package is used for tidy data?