用Dev-c++编C程序时,编译报错,错误提示和代码如下,请问如何解决该问题。。初学C
错误提示[Linkererror]undefinedreferenceto'winmain@16'ldreturned1exitstatus代码isprime(n)int...
错误提示
[Linker error]undefined reference to 'winmain@16'
ld returned 1 exit status
代码
isprime(n)
int n;
{int i=1;
while(++i<n)
if(n%i==0)
{printf("%d is not prime\n",n);
break;}
if(i==n)
printf("%d is prime\n",n);
} 展开
[Linker error]undefined reference to 'winmain@16'
ld returned 1 exit status
代码
isprime(n)
int n;
{int i=1;
while(++i<n)
if(n%i==0)
{printf("%d is not prime\n",n);
break;}
if(i==n)
printf("%d is prime\n",n);
} 展开
2个回答
展开全部
改为:
int n;
int main()
{int i=1;
while(++i<n)
if(n%i==0)
{printf("%d is not prime\n",n);
break;}
if(i==n)
printf("%d is prime\n",n);
}
int n;
int main()
{int i=1;
while(++i<n)
if(n%i==0)
{printf("%d is not prime\n",n);
break;}
if(i==n)
printf("%d is prime\n",n);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询