学长们帮我看一下为啥26501判断不对啊,三组对了它没有

#include
int main()
{int a,b,c;

scanf("%d",&a);

for(b=2;a>b;b++){
    if(a%b==0){
        c=0;
    
    }
    }
    if(c==0){
        printf("This is not a prime."); 
    }else{printf("This is a prime."); 
    }
return 0;}

逻辑体系有漏洞,导致你无论输入什么都是:
This is not a prime.
原因:如果你输入的数不是素数,没问题。
如果你输入的是素数,因为你没给c赋值,
编译器默认c=0,结果就是判断不是素数。
解决:在if后面加个else{c=1;}

c没初始化为1

if之后没有写else定义c=1

变量c 没有初始化