### Test: Computer Science

public static boolean remove(int[] arr, int val) {

boolean found = false;

int i;

for(i = 0; i < arr.length && !found; i++) {

if(arr[i] == val) {

found = true;

}

}

if(found) {

for(int j = i; j < arr.length;j++) {

arr[j - 1] = arr[j];

}

arr[arr.length - 1] = 0;

}

return found;

}

 1 For the code above, what will be the content of the variable arr at the end of execution, if the method is called with the following values for its parameters: arr = {3,4,4,5,17,4,3,1} val = 4

{3, 5, 17, 3, 1, 0, 0, 0}

{3, 5, 17, 3, 1}

{3, 4, 5, 17, 4, 3, 1}

{3, 4, 5, 17, 4, 3, 1, 0}

1/2 questions

0%

## Access results and powerful study features!

Take 15 seconds to create an account.