Question: What is the output of the following recursive function? package recursion; public class rec4 { public static int cal(int n, int r) { if

What is the output of the following recursive function? package recursion; public 

What is the output of the following recursive function? package recursion; public class rec4 { public static int cal(int n, int r) { if (n > 0) } else return (nr + cal(n/r, r)); return 0; public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(cal (345, 10)); }

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 Computer Network Questions!