fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n;
  5. printf("Enter the number: ");
  6. scanf("%d",&n);
  7. int a=0;
  8. for(int i=2;i<=n-1;i++){
  9. if(n%i==0){
  10. a=1;
  11. break;
  12. }
  13. }
  14. if(a==0) printf("Prime");
  15. else printf("composite");
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0.01s 5288KB
stdin
97
stdout
Enter the number: Prime