Md_hosen_zisad

normalprime

Aug 8th, 2017
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int flag=1,i, n;
  5.     printf("enter number ::");
  6.     scanf("%d",&n);
  7.     for(i=2;i<n;i++)
  8.     {
  9.     if(n%i==0)
  10.     {
  11.         flag=0;
  12.         break;
  13.     }
  14.     }
  15.     if(flag==1)
  16.     {
  17.         printf("prime");
  18.     }
  19.     else
  20.     {
  21.         printf("not prime");
  22.     }
  23.     return 0;
  24. }
Add Comment
Please, Sign In to add comment