+ 1
Check the prime number using for ?
To find all the prime numbers to a given number. Prime number ? What is code ?
2 Answers
0
What exactly are you asking?
If youâre asking what a prime number is, itâs any integer greater than 1 which is divisible only by one and itself. There are infinite prime numbers beginning with: 2, 3, 5, 7, 11, 13, 17, 19, 23âŠ
One simple algorithm for finding all primes less than n is the Sieve of Eratosthenes. My implementation here is in C, but you can find more information on Wikipedia if you donât have experience with Câthe algorithm is famous.
https://code.sololearn.com/cxCZ368BeI0J/?ref=app
0
Hint: use Modulo operator.
Workout your brain!