Re: My First Java Program
The problem is with the distribution of primes. So you cannot depend on rows and columns alone to determine when
to print a new line. You need to count the primes generated against a running maximum per line. When you print a new line,
set the count to zero and bump the maximum by one.
Also, if you think about the nature of primes (even vs odd), remainders, etc you can significantly improve your algorithm.
For more on this check out the Sieve of Erastosthenes.