Skip to content

Commit

Permalink
Solução para o desafio 2 em Java (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmrsilva authored and marcopaganini committed Mar 11, 2019
1 parent e094b2c commit 2805576
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions desafio-02/danielmascarenhas/java/Primos.java
@@ -0,0 +1,17 @@
public class Primos {

public static void main(String[] args) {

for (int i = 2; i < 1000; i++) {
boolean primo = true;
for (int j = 2; j < i; j++) {
if (i % j == 0) {
primo = false;
break;
}
}
if (primo)
System.out.println(i);
}
}
}

0 comments on commit 2805576

Please sign in to comment.