Created
August 11, 2014 15:25
-
-
Save shohan4556/7a04d8bca6686d63a8eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int i,num,count=0; | |
printf ("Enter the to test: "); | |
scanf ("%d",&num); | |
for(i=2;i<=num/2;i++){ | |
if (num%i==0) | |
count++; | |
break; | |
} | |
if (count==0 && num!=1) | |
printf ("%d is Prime\n",num); | |
else | |
printf ("%d is not Prime",num); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment