I need to make a for loop that will find the smallest number that a can be devided by(boolean) this is my code so far: import java.util.Scanner; public class Oving2d { public static void main(String[]args) { deleTo(0, 0); } public static boolean deleTo(int a, int b){ Scanner input = new Scanner(System.in); boolean sjekk; System.out.println("write number a: "); a=input.nextInt(); System.out.println("write number b: "); b=input.nextInt(); if (a%b == 0) { sjekk = true; System.out.println("true"); return sjekk; } else { sjekk = false; System.out.println("false"); return sjekk; } } }
Explanation / Answer
public class Revision { public static int arr[] = new int[] { 5, 8, 4, 3, 6, 2 }; public static int min = 1; public static int arrayMin() { int i = 0; if (arr == null) { return 0; } else { while (i