** `count` starts to 1 because we already know that 2 is prime ** but it will not be computed in this loop as we skip all even numbers */
| 46 | ** but it will not be computed in this loop as we skip all even numbers |
| 47 | */ |
| 48 | int main(void) { |
| 49 | int limit = 10001; |
| 50 | int count = 1; |
| 51 | int result; |
| 52 | |
| 53 | for (int nb = 1; count < limit; nb += 2) { |
| 54 | if (isPrime(nb)) { |
| 55 | count++; |
| 56 | result = nb; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | printf("%d\n", result); |
| 61 | } |