Skip to content

Latest commit

 

History

History
18 lines (17 loc) · 301 Bytes

ex7.md

File metadata and controls

18 lines (17 loc) · 301 Bytes

Find 10 001st prime

void findPrime(int end) {
  // counted: 2 3  
  int current = 5;
  int count = 2;
  while (count < end) {
    if (isPrime(current)) {
      count++;
      if (count == end) {
        print("Prime: ${current}, Count: ${count}");
      }
    }
    current += 2;
  }
}