#include <stdio.h>
#include <math.h>

int main() {
    int n,i;
    printf("enter a positive integer\n");
    scanf("%d",&n);
    
if (n==0 || n==1) {
    printf("not prime");
    }
    
    for(i=2;i<=n/2;++i) {
        if (n % i == 0){
            printf("not prime \n");
            break;
        
    } else {
        printf("prime");
        
    }}
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: