fork download
  1. #include <stdio.h>
  2. int main(void)
  3. {
  4. int i, n;
  5. printf("Input n:");
  6. scanf("%d",&n);
  7. i=1;
  8. while(i<=n)
  9. {
  10. if(n%i==0)
  11. { printf("%d,",i);
  12. }
  13. i++;
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5324KB
stdin
10
stdout
Input n:1,2,5,10,