Created
May 3, 2012 20:18
-
-
Save godie007/2588981 to your computer and use it in GitHub Desktop.
Mire
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Empresa; | |
| public class NumPrimo { | |
| public static void main(String[] args) { | |
| System.out.println("1"); | |
| for (int i = 1; i <= 100; i++) { | |
| int contador = 0; | |
| for (int j = 1; j <= i; j++) { | |
| if (i % j == 0) | |
| contador++; | |
| } | |
| if (contador == 2) | |
| System.out.println(i); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment