What will be the output from the following code if the user enters 4. int[] list = {1, 4, 4, 2, 5, -3, 6, 2}; int toSearch = input.nextInt(); int location = -1; for(int i = 0; i < list.length; i++) { if(list[i] == toSearch) { location = i; } } System.out.print(location); Solution Program: import java.io.*; import java.util.Scanner; public class Ary { public static void main(String[] args) { int[] list = {1, 4, 4, 2, 5, -3, 6, 2}; Scanner input = new Scanner(System.in); // here we are scanning the input from the user int toSearch = input.nextInt(); int location = -1; for(int i = 0; i < list.length; i++) { if(list[i] == toSearch) { location = i; } } System.out.println(location); // here we are printing the corresponding element in the list based on user input } } //if the user enters number 4 the output of the above code is as follows Output: 4 2.