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. break;
  11. }
  12. }
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 5284KB
stdin
10
stdout
Enter the number: The number is composite