0

I am trying to make a program that displays the nth prime number. I don't get compiler errors but it doesn't display the prime number. I don't know where it stops, ive tried breakpoints but it stilll doesnt work :(.

here is the code:

```
package primenumberfinder;
import java.util.Scanner;
/**
*
* @author Toby
*/
public class PrimeNumberFinder {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int userChoice;
int place = 0;
//sets users choice, if uc is 2 then second prime number
System.out.println("Which prime number do you want? ");
Scanner scanner = new Scanner(System.in);
userChoice =scanner.nextInt();
for(int i = 0;i <= userChoice;){
for (int n = i;;n++){
int checker = 0;
for(int c = n;;c--){
//checks to see if c== o, else, checks if n/c has remainder
//if yes checker++
if (c==0){
break;
}else if((n % c) != 0 ){
checker++;}
}
//when checker == n, it should be a prime number.
//Itll add this prime number to place
if (checker == n){
place = n;
break;
}
}
// increments i and loops through to create the next prime
i++;
}
//prints prime number
System.out.println(place);
}
}
```