Question: if i enter 12 explain how the answer is 9 by doing it step by step public static int recmethod (int n) { if (n
if i enter 12 explain how the answer is 9 by doing it step by step
public static int recmethod (int n) { if (n == 3){ return 3; } return recmethod ((n % 4) + 1) + 2; }
Step by Step Solution
3.42 Rating (171 Votes )
There are 3 Steps involved in it
Lets break down the code step by step for the input value 12 You call the recmethod function with th... View full answer
Get step-by-step solutions from verified subject matter experts
