Summing Elements in Array
Hi, I've been doing learning and I have come to encounter this issue. QUESTION : You are given a program that takes the length of the array as the 1st input, creates it & then takes the next inputs as elements of the array. Complete the program to go through the array & calculate the sum of the numbers that are multiples of 4. // I did add a couple of lines so that the programme can get through which i/put is the multiple of 4. However, the results keep showing, the class was not found. Pls, help me. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int length = scanner.nextInt(); int[] array = new int[length]; for (int i = 0; i < length; i++) { array[i] = scanner.nextInt(); } //your code goes here int sum = 0; if (array[i] % 4 ==0);{ sum = sum += array[i];{ System.out.println(sum); } } } }