Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void prime(long n) {
- long a = 1, count = 0, i;
- while (count < n) {
- a++;
- for (i = 2; i <= a; i++) {
- if (a%i == 0) {
- break;
- }
- }
- if (i==a) {
- count++;
- }
- }
- System.out.println(a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement