[Solved] Code coach Divisible
What is the problem with this program? Case 3 is not passing. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Program { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int a = Integer.parseInt(reader.readLine()); String s = reader.readLine(); Divisible.div(a, s); } } class Divisible { public static void div(int a, String b) { String[] c = b.split(" "); int res = 0; for (int i = 0; i < c.length; i++) { if (Integer.parseInt(c[i]) == 0){ res++; } else if (a % Integer.parseInt(c[i]) == 0) { res += res; } else{ res++; } } if (res == 0) { System.out.println("divisible by all"); } else { System.out.println("not divisible by all"); } } }