Skip to content

Commit

Permalink
On branch dev (#997)
Browse files Browse the repository at this point in the history
Changes to be committed:
	new file:   desafio-02/wasluissp/cpp/primo.cpp
  • Loading branch information
wasluissp authored Aug 10, 2023
1 parent c70df67 commit 48a99b8
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions desafio-02/wasluissp/cpp/primo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>

using namespace std;

int main() {
int i, j;
bool isPrime;

for (i = 2; i <= 10000; i++) {
isPrime = true;
for (j = 2; j * j <= i; j++) {
if (i % j == 0) {
isPrime = false;
break;
}
}
if (isPrime) {
cout << i << endl;
}
}

return 0;
}

0 comments on commit 48a99b8

Please sign in to comment.