Home / MCQ Bank / Computer
Computer Functions And Methods In C Sharp

What will be the output of the following C# code? class box { int width; int height; int length; int volume; void volume(int height, int length, int width) { volume = width * height * length; } } class Prameterized_method { public static void main(String args[]) { box obj = new box(); obj.height = 1; obj.length = 5; obj.width = 5; obj.volume(3, 2, 1); Console.WriteLine(obj.volume); Console.ReadLine(); } }

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

Related Computer Questions

Which of these classes provide implementation of map interface? What will be the output of the following Python code snippet? not(10<20) and not(10>30) What will be the output of the following Python code? for i in range(float('inf')): print (i) Which of the following is not an application of inclusion-exclusion principle? What is the purpose of the 'void' keyword in a function declaration in C++?