fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n,i,count=0;
  5.  
  6. printf("enter n: ");
  7. scanf("%d",&n);
  8.  
  9. printf("Factors: ");
  10.  
  11. for(int i=1;i<=n;i++){
  12. if(n%i==0){
  13. printf("%d,",i);
  14. count++;
  15. }}
  16.  
  17. printf("\n");
  18. printf("number of factots: %d\n",count);
  19.  
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
enter n: Factors: 1,22031,
number of factots: 2