Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char *argv[]) {
- //int primeList[numberOfPrimesToFind];
- //primeList[0] = 2;
- int numberOfPrimesToFind = 5;
- int startn = 3;
- while(startn < numberOfPrimesToFind) {
- for(int divn = 2; divn < startn; divn++) {
- // divn = 2, startn = 3. 2 < 3? Yes. Proceed.
- if(startn % divn == 0) { // if startn is not prime number, go to the next number to check.
- startn++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement