What is the output of the following code snippet?
Public static int fun(int x)
{
Int returnValue = 0;
If (x > 5)
{
ReturnValue = x;
}
Else
{
ReturnValue = fun(2 * x) ;
}
Return returnValue;
}
Public static void main(String[] args)
{
System.out.println("fun(2) = " + fun(2) ) ;
}
A) fun(2) = 4
B) fun(2) = 8
C) fun(2) = 16
D) fun(2) = 32
Correct Answer:
Verified
Q80: What is incorrect in the following code
Q81: What is the output of the following
Q82: Which of the following code snippets returns
Q83: What is the output of the following
Q84: Given the method below, what is the
Q86: What is the output of the following
Q87: Based on the code snippet below, which
Q88: Which of the following is correct about
Q89: For the given code snippet, which of
Q90: Which method header is appropriate for this
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents