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