Question: Given the method f 3 ( ) below, what does f 3 ( 1 0 2 0 0 ) return? public static int f 3

Given the method f3() below, what does f3(10200) return?
public static int f3(int n){
if (n ==0)
return 1;
else if (n <10 && n >-10)
return 0;
else
return f3(n /10)+ f3(n %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 Databases Questions!