#include <stdio.h>
int main()
{
    int i, num, Prime;
    Prime = 1; 

    printf("Enter any number to check prime: ");
    scanf("%d", &num);

    for(i=2; i<=num/2; i++)
    {
        if(num%i==0)
        {
            Prime = 0;
            break;
        }
    }

   
    if(Prime == 1 && num > 1)
    {
        printf("%d is prime number", num);
    }
    else
    {
        printf("%d is composite number", num);
    }

    return 0;
}

Embed on website

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