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

What will be the output of the following C# code snippet? class maths { int fact(int n) { int result; if (n == 1) return 1; result = fact(n - 1) * n; return result; } } class Output { static void main(String args[]) { maths obj = new maths() ; Console.WriteLine(obj.fact(4)*obj.fact(2)); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option D • 48

Related Computer Questions

What is the result of the expression "Hello".toUpperCase().toLowerCase() in Java? In Python, how can you check if a key exists in a dictionary? What is windows registry? Which data type is used to store a single character in Java? What is the purpose of the 'break' statement in a switch-case construct in C++?