帮你添加一些括号你在看看程序
#include <stdio.h>
int fun(int x)
{
int i,j,count=0;
printf("\nThe prime number between 2 to %d\n",x);
for(i=2;i<=x;i++)
{
for(j=2;j<i;j++)
{
if(i%j==0)
break;
}
if(j>=i)
//////////////////////////
{
count++;
printf(count%15 ? "%5d" : "\n%5d",i);
}
}
return count;
}
main()
{
int x=20,result;
result=fun(x);
printf("\nThe number of prime is :
%d\n",result);
}