fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int n;
  5. printf("Enter the number: ");
  6. scanf("%d",&n);
  7. for(int i=2;i<=n-1;i++){
  8. if(n%i==0)
  9. printf("The number is composite");
  10. }
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0.01s 5276KB
stdin
10
stdout
Enter the number: The number is compositeThe number is composite