Question: public static void mystery 2 ( int a , int b ) { if ( a % b = = 0 ) { a =

public static void mystery2(int a, int b){
if (a % b ==0){
a = a / b;
if (a < b){
b = b - a;
}
} else if (b %2==0){
b = b /2;
} else {
a = a - b;
}
System.out.println(a +""+ b);
}
mystery2(20,4);
mystery2(7,6);
mystery2(14,7);
mystery2(24,8);
mystery2(13,9);

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!