素数是不是质数啊?
小弟编了个判断质数的,程序是能正确地判断出来,但在循环那里出了问题。结果会循环几次打出来,能怎么改变???
#include <stdio.h>
main()
{
int i,j;
printf("input the number which want to be checked");
scanf("%d",&i);
for(j=2;j<i;j++)
{
if(i%j!=0) printf("%d",i);
else
printf("the number is not a prime");
}
}