Advertisement
zfhridoy47

loop_problem_11

Jun 25th, 2019
96
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 n,i,p;
  5.     scanf("%d", &n);
  6.     p=0;
  7.     for(i=1;i<=n;i++){
  8.          if(n%i==0){
  9.           p++;
  10.          }}
  11.          if(p==2)
  12.          {
  13.             printf("Prime number");
  14.          }
  15.         else
  16.         {
  17.             printf("Not a Prime number");
  18.         }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement