Consider the following method to compute the greatest common
denominator of two numbers.
Say we call gcd(42, 54). Show how the values of r, m, and n change as the computer continues through the method.public static int gcd(int m, int n) { int r; while(m != 0) { r = m % n; m = n; n = r; } return m; }
r m 42 n 54
r 42 12 6 0 m 42 54 42 12 6 n 54 42 12 6 0