0
How to check for prime numbers using only the for loop?
I have a task and i cannot do it. Please help.
2 odpowiedzi
+ 3
Your constraint doesn't really make sense to me, you need to use some calculations and conditions too at least.
If you need an algorithm to calculate primes, read a bit first and then try to design the logic of your program.
https://en.m.wikipedia.org/wiki/Trial_division
It is also advisable to put the programming language in the tag of your question, that way you can get more specific advice.
0
You need to use an if statement inside the for loop.