#include<stdio.h>
int prime(int n1,int n2){
    int i, j, isPrime;
    for(i=n1; i<=n2; i++)
    {
        /* Assume that the current number is Prime */
        isPrime = 1; 

        /* Check if the current number i is prime or not */
        for(j=2; j<=i/2; j++)
        {
            /*
             * If i is divisible by any number other than 1 and self
             * then it is not prime number
             */
            if(i%j==0)
            {
                isPrime = 0;
                break;
            }
        }

        /* If the number is prime then print */
        if(isPrime==1)
        {
            printf("%d, ", i);
        }
    }

}
int main(){
    int n1=10,n2=20;
    prime(n1,n2);
}

Embed on website

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