And wrap your code in code tags for better readability.
Type: Posts; User: Mr.777
And wrap your code in code tags for better readability.
while (i <= n)
{
if(i%n == 0)
System.out.println(i);
else
i++;
}
Look carefully. When your program is going to else part? What is the value of i? Why doesn't it change...