Monday , January 22 2018
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

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 – Addition of two Matrices Example

C Program to Addition of two Matrices. Addition of two Matrices : Happy Learning 🙂

Leave a Reply

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