Question: 20. Below is the CORRECT version of the gcd algorithm with no logical errors. Say you run this function with inputs n1 = 9, n2


20. Below is the CORRECT version of the gcd algorithm with no logical errors. Say you run this function with inputs n1 = 9, n2 = 26, and you set a breakpoint at line 4. What is the value stored in variable n2 when the program reaches this breakpoint (before it executes the line). public static void gcd(int n1, int n2) { while(n1 != n2) { 2 if (n1 > n2) { n2; 4 n1 } else { n2 -- n1; } } System.out.println(n1); 10 A. 9 B. 26 C. 8 (ANSWER) D. 17 E. None of the above 21. Consider the following snippet of code. public static void main (String[] args) { {3,5,7}; { 4,6,8}; int[] one int[] two int[][] a mistery (a, one, two); System.out.println (Arrays.deepToString (a)); {one, two}; } public static void mistery (int[ ] b, int[] one, int[] two) { new int [2][3]; int[][] a = b[1] = a[0]; a [0] = two; a[1] for (int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
