both inner and outer loops are checking only within possible limits. the even numbers are not checked even once throughout the process. Why this code performs better than already accepted ones:
Checkout the results for different N values in the end. My code takes significantly lesser iteration to finish the job. Using Sieve of Eratosthenes logic, I am able to achieve the same results with much faster speed. How would I need to change this code to the way my book wants it to be? int main () By contrast, numbers with more than 2 factors are call composite numbers. For example, the first 5 prime numbers are 2, 3, 5, 7, and 11. So I did try changing my 2nd loop to for (int j=2 j