c5-9-1.c 261 B

1234567891011
  1. #include <stdio.h>
  2. int main()
  3. {int n,i;
  4. printf("please enter a integer number,n=?");
  5. scanf("%d",&n);
  6. for (i=2;i<=n-1;i++)
  7. if(n%i==0) break;
  8. if(i<n) printf("%d is not a prime number.\n",n);
  9. else printf("%d is a prime number.\n",n);
  10. return 0;
  11. }