I'm trying to write a code that finds the nth prime

Code:
#include <stdio.h>
#include <stdlib.h>




int main()
{
    _Bool restart = 1;
    int answer;
    while (restart)
    {
        int prime, n, i, count, c;
        _Bool isPrime = 1;


        printf("For which prime number do you want to know the value of?\n");
        scanf("%i", &n);


        if (n == 1)
            printf("(1) Prime number is 2\n");
        if (n == 2)
        {
            printf("(1) Prime number is 2\n");
            printf("(2) Prime number is 3\n");
        }


        count = 1;
        prime = 2;
        i = 1;


        if (n >= 1)
        {
            while (i <= n)
            {
                
                for ( c = 2 ; c <= prime && isPrime ; c++ )
                {
                    if ( prime%c == 0 )
                        isPrime = 0;
                }
                printf("(%i) Prime number is %i\n", count, prime);
                i++;
                count++;
                prime++;
                //printf("%i\n", prime);
            }
        }
        restart = 0;
        printf("Restart? 1 for yes, 0 for no\n");
        while (1)
        {
            scanf("%i", &answer);
            if (answer > 1 || answer < 0)
                printf("enter either 1 or 0\n");
            else
                break;
        }
        restart = answer;
    }
    /*
    printf("Restart? 1 for yes, 0 for no");
    while (1)
    {
        scanf("%i", &answer);
        if (answer > 1 || answer < 0)
            printf("enter either 1 or 0");
        else
            break;


    }
    restart = answer;
    */




}
but it's not calculating correctly... what Im I doing wrong?