Home / MCQ Bank / Computer
Computer Constructors And Methods Difficulty: Medium

What will be the output of the following Java program? class recursion { int func (int n) { int result; if (n == 1) return 1; result = func (n - 1); return result; } } class Output { public static void main(String args[]) { recursion obj = new recursion() ; System.out.print(obj.func(5)); } }

Select the correct option to test your answer:

More Computer Questions

Data becomes____________when it is presented in a format that people can understand and use. What will be the output of the following C code? #include <stdio.h> int mul(int a, int b, int c) { return a * b * c; } void main() { int *function_pointer; function_pointer = mul; printf("The product of three numbers is:%d", function_pointer(2, 3, 4)); } Which Excel feature allows you to freeze rows and columns so they remain visible while scrolling? Which Conversion function of 'Convert.TOInt32()' and 'Int32.Parse()' is efficient? i. Int32.Parse() is only used for strings and throws argument exception for null string ii. Convert.Int32() used for data types and returns directly '0' for null string What is the primary purpose of a data mart in data modeling?