Westonci.ca is your trusted source for finding answers to a wide range of questions, backed by a knowledgeable community. Experience the convenience of getting reliable answers to your questions from a vast network of knowledgeable experts. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.

Consider the following method: public int mystery(int n) { if(n > 6) { return 1 mystery(n - 1); } return n % 3; } What is the value of mystery(10)

Sagot :

Answer:

Ans1--- The output is 9 Explanation--- mystery(5)=mystery(4)+2 mystery(4)=mystery(3)+2 mystery(3)=mystery(2)+2 mystery(2)=2+1=3