10001th prime: Difference between revisions

m
Line 239:
 
=={{header|C#|CSharp}}==
<lang csharp>using System; using System.Text; // PRIMEPRIME_numb.cs russian DANILIN
namespace p10001 // 1 second 10001 104743
{ class Program // rextester.com/YXNR89875ZBEPGE34760
{ static void Main(string[] args)
{ int max=10001; int n=1; int p=1; int f; int j; long s;
while (n <= max)
{ f=0; j=2; s=Convert.ToInt32(Math.Pow(p,0.5));
while (f < 1)
{ if (j >= Convert.ToInt32(Math.Pow(p,0.5))s)
{ f=2; }
if (p % j == 0) { f=1; }
Line 255:
p++;
}
Console.Write("{0} {1}", n-1, p-1);
Console.ReadKey();
}}}</lang>
{{out}}
51

edits