Indented Code:

Code:

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
long unsigned int limit=4294967294;
long unsigned int n,i,flag,j=1;
clrscr();
for (n=2; n<limit; n++)
{
flag=1;
if (n==2)
{
printf("2");
continue;
}
else
{
if (n%2==0)
{
continue;
}
}
for (i=3; i<=sqrt(n)+1; i+=2)
{
if (n%i==0)
{
flag=0;
break;
}
}
if (flag==1)
{
j++;
printf("%luth prime is %lu\n",j,n);
}
}
getch();
}

As for your question adak, i dont know file handling at all, so i will need some very specific pointers to it. I know it sounds lame, but havent yet learnt it.