Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (count = 2; count <= n; ) {
- for (j = 2; j <= Math.sqrt(num); j++) {
- if (num % j == 0) {
- status = 0;
- break;
- }
- }
- if (status != 0) {
- System.out.println(num);
- count++;
- }
- status = 1;
- num++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement