Question: Java 1) what is output when n = 25? public void f1(int n) { if (n == 0) System.out.printf(Zero); ; System.out.printf(%d, n%2); f1(n/2); } 2)

Java

1) what is output when n = 25?

public void f1(int n) { if (n == 0) System.out.printf("Zero"); ;

System.out.printf("%d", n%2); f1(n/2); }

2) What is output for f(2)?

public int f(int n)

{

if (n == 4)

return n;

else return 2*f(n+1);

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!