Monday , November 20 2017
Home / c-program / C Program – Find a number is prime or not

C Program – Find a number is prime or not

C Program to find a given number is prime or not.

is Prime or not ?

int main(void) 
    int i,n; 
    printf("Enter any number : "); 
    for(i=2; i<=sqrt(n); i++)     
        printf("%d is prime number :)\n",n); 
        printf("%d is not a prime number :!\n",n); 
    return 0; 

Enter any number : 5
5 is prime number 🙂

Enter any number : 10
10 is not a prime number :!

Happy Learning 🙂

About chandrashekhar

Hi Folks, you have reach this so far, that shows you like what you are learning. Then why don't you support us to improve for bettor tutorials by leaving your valuable comments and why not you keep in touch with us for latest updates on your favorite blog @ facebook , twitter , Or Google+ ,


C Program to add elements of an array

How to add elements in an array using C Program. Add elements of an Array …

Leave a Reply

Your email address will not be published. Required fields are marked *