I am trying to get a program to work that asks for a user input to count by that number and display 10 numbers per line. I can not get it to display 10 numbers per line. If anyone can explain to me what I am doing wrong?
public static void main(String[] args)
{
//final int START = 5;
final int STOP = 500;
int NUMBER_PER_LINE = 10;
Scanner val = new Scanner(System.in);
System.out.println("Enter your value ");
int START =val.nextInt();
for(int i = START; i <= STOP; i +=START)
{
System.out.print(i + " ");
if(i % NUMBER_PER_LINE == 0)
System.out.println();
val.close();
}
}