writing a program (using java) that is suppose to find the lowest integer that can be evenly divided by a range (ex. 1-25). I need help fixing/debugging it so it comes up with the proper output. this is the part of my code that does the calculations
void main(String[] args){
int num = lowest(1,25);
System.out.println("The smallest divisible number is" + num);
}
public static int lowest(int lower_limit, int upper_limit){
boolean find = false;
int L = upper_limit;
while (find) {
boolean yes = true;
for (int j=lower_limit; j<= upper_limit; j++) {
if (j/L != (L/j ))
break;
yes = false;
}
if (yes){
find = true;
}
else{
L++;
}
}
return L;
}
}