I wrote this code to show the primes between 1 and 100. The only condition is to do not use functions, whole code should be inline. I would ask if I can improve (optimize) it mu
for(int j=2;j
This one is not nice.
First of all, you only need to check for j <= sqrt(i), as for example 7 will never divide 12 without a rest.
Second, you should keep track of all previously found prime numbers; keep it in vector and only do this loop for it's contents and for that condition I wrote.