Created
June 16, 2011 19:18
-
-
Save eduardodaluz/1030007 to your computer and use it in GitHub Desktop.
Estrutura de repetição Java
This file contains 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
public class MegaSena { | |
public static void main(String[] args) { | |
System.out.println("Números da Mega Sena"); | |
for (int i = 0; i <= 60; i++) { | |
System.out.print(i + ","); | |
} | |
System.out.println("final ..."); | |
} | |
} |
This file contains 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
public class SenaDoWhile { | |
public static void main(String[] args) { | |
System.out.println("Números da Mega Sena"); | |
int i = 1; | |
do { | |
System.out.println(i + ", "); | |
i++; | |
} while (i <= 60); | |
System.out.println("final ..."); | |
} | |
} |
This file contains 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
public class SenaWhile { | |
public static void main(String[] args) { | |
System.out.println("Números da Mega Sena"); | |
int i = 1; | |
while (i <= 60) { | |
System.out.println(i + ", "); | |
i++; | |
} | |
System.out.println("final ..."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment