Question: question: what the method will return if you pass 3874 as a value for n ? public static ont m1 (int n ) { if

question: what the method will return if you pass 3874 as a value for n ?

public static ont m1 (int n )

{

if (n

return n;

else

{

int x = n % 10 ;

int y = m1 (n / 10 );

if ( x > y )

return x;

else

return y;

}

}

Explain it in details please.

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 Programming Questions!