Let me explain the problem.
I need to write a program where I enter a number N and, then I must find the minimum number divisible by all the numbers down to one.
Eg:. If my N is 5, the answer would be 60. 60 is divisible by 5, 4, 3, 2 and 1.
Here is what I have so far...
import java.util.Scanner;
public class Questão_04 {
public static void main (String [] args)
{
int x = 1, n = 1, d = x % n;
System.out.print("Enter N: ");
Scanner in = new Scanner(System.in);
n = in.nextInt();
do
{
if (d != 0)
{
x = x + 1;
do
{
n = n -1;
} while (n != 0);
}
else
{
do
{
n = n - 1;
} while (d != 0);
}
} while (n != 0);
System.out.print(x);\\the minimum number divisible by N and all up to N.
}