Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Aufgabe1 {
- public boolean isPrim(int zahl) {
- for (int j = 2; j < zahl; j++) {
- if (zahl % j == 0) {
- return false;
- }
- }
- return true;
- }
- public static void main(String[] argv) {
- Aufgabe1 M = new Aufgabe1();
- for (int n = 10; n <= 10000; n++) {
- if (M.isPrim(n) == true) {
- System.out.println(n);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement