Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Kisebbprim {
- public static void main (String[] args) {
- int n;
- n = (int)Math.round(Math.random()*100+100);
- System.out.println(n);
- for (int i = 2; i <= n; i++) {
- for (int j = 2; j <= i; j++) {
- if (j == i) {
- System.out.println(i);
- }
- if (i % j == 0) {
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement