#include <stdio.h>
int main()
{
    int n,i,flag=0;
    scanf("%d",&n);
    printf("Enter the value of the number n=%d\n",n);
    for(i=2;i<n;++i)
    {
        if(n%i==0)
        {
            flag=1;
            break;
        }
    }
    if(flag==0)
    {
        printf("%d is a PRIME NUMBER",n);
    }
    else
    {
        printf("%d is not a PRIME NUMBER",n);
    }
    return 0;
}

Embed on website

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