Prime or not in C

Source code :

#include<stdio.h>

int main()
{
    int i,r=0,s=0;
    
    int n = 5;
    
    for(i=2;i<n;i++)
    {
        s=n%i;
        
        if(s==0){
            r=1;
            break;
        }
    }
    
    if(r==0){
        printf("%d is prime number",n);
    }
    else{
        printf("%d is not prime number",n);
    }

    return 0;
}

Output :

5 is prime number

Output :


                

Comments :