Home / Expert Answers / Computer Science / given-the-following-recursive-function-public-static-void-fun-int-mathrm-x-quad-pa469

(Solved): Given the following recursive function: public static void fun(int \( \mathrm{x}) \) \{ \( \quad \ ...



Given the following recursive function:
public static void fun(int \( \mathrm{x}) \)
\{ \( \quad \) int \( \mathrm{y} ; \)
if

Given the following recursive function: public static void fun(int \( \mathrm{x}) \) \{ \( \quad \) int \( \mathrm{y} ; \) if \( (\mathrm{x}>0) \) \{ \( \mathrm{y}=\mathrm{x} \div 2 ; \) \( \mathrm{x}=\mathrm{x} / 2 ; \) fun \( (\mathrm{x}) ; \) System.out.print(y); \}//end of if \}//end of method What is the output of fun ( 6\( ) ? \) ( 2 marks) A. 011 B. 110 C. 0 D. 11


We have an Answer from Expert

View Expert Answer

Expert Answer


A java program is given. Need to the output.
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe