// 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73
using System;
class CalculateNthPrimeNumber_CSharp
{
static int GetTheNthPrimeNumber(int nth) {
int prime = 1, count = 0, i;
while (count < nth) {
prime += 1;
for (i = 2; i <= prime; i++) {
if (prime % i == 0) {
break;
}
}
if (i == prime) {
count = count + 1;
}
}
return prime;
}
static void Main() {
int nth = 8;
Console.Write("Nth prime: " + GetTheNthPrimeNumber(nth));
}
}
/*
run:
Nth prime: 19
*/