public float CurrentNumber = 98939;
public int PrimeCounter = 9499;
public int GoalPrime = 10002;
public static bool Stop = false;
public static bool First = true;
public bool ContinueCheck;
public static void Main()
Program prg = new Program();
if(CurrentNumber%2f !=0f)
for(float X = 3; X <= CurrentNumber ; X++)
if(CurrentNumber%X == 0f && X!=CurrentNumber)
else if(ContinueCheck && X==CurrentNumber)
if(PrimeCounter==GoalPrime)
Console.WriteLine("Prime #"+GoalPrime+" = "+CurrentNumber);