本人编写的打印质数的程序,请多指教!
#include<stdio.h>
#include<math.h>
void main()
{
int siz,i,flage;
unsigned long int var=0,ifzs=3,mul=2;
siz=sizeof(unsigned long int);
printf("unsigned width is %d\n",siz);
i=siz*8;
printf("i=%d\n",i);
/* do
{
if(i>1)
printf("%lu:",var);
else
printf("%lu:",var-1);
printf("%d\t",i);
var*=2;
--i;
}while(i>0);
*/
printf("\n2^64=%lu\n",var-1);
do
{
mul=2;
flage=1;
do{
if(ifzs%mul==0)
{ flage=0;
break;}
else
{ ++mul;}
}while(mul<=sqrt(ifzs));
if(flage)
{printf("%lu\t",ifzs);
++ifzs;}
else
{ ++ifzs;
}
}while(ifzs<100000);
printf("\n");
}