Of course there is. Prime number generation is one of the most-researched subjects in computer sciences and mathematics, so there's plenty of other variations out there to study.
What are you asking for? j already is being replaced with all candidate numbers to check for being an integral divider, time-sequentially within the loop.Quote:
This particular line does what its supposed to do:
however, is there any way possible to replace 'j' wtih all the numbers that have actually been generated?Code:if (i % j == 0)