Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // C program to check whether a number is Prime number or not.
- #include<stdio.h>
- int main(){
- int x,count=0,i;
- printf("Enter a number :");
- scanf("%d",&x);
- for(i=2;i<x;i++)
- if(x%i==0){
- count++;
- break;}
- if(count==0)printf("%d is Prime Number\n",x);
- else printf("%d is not a Prime number\n ",x);
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment