fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int num,k;
  5. printf("please enter the number:");
  6. scanf("%d",&num);
  7. int a=2;
  8.  
  9. while(a<num){
  10. k=num%a;
  11. a=a+1;
  12. if(k == 0){
  13. printf(" number is composite");
  14. return 0;
  15. }
  16.  
  17.  
  18. }
  19.  
  20. printf("number is prime");
  21. return 0;
  22. }
Success #stdin #stdout 0s 4488KB
stdin
Standard input is empty
stdout
please enter the number: number is composite