MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / main

Function main

project_euler_problems/10001st prime/solution.c:48–61  ·  view source on GitHub ↗

** `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 */

Source from the content-addressed store, hash-verified

46 ** but it will not be computed in this loop as we skip all even numbers
47 */
48int 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}

Callers

nothing calls this directly

Calls 1

isPrimeFunction · 0.70

Tested by

no test coverage detected