TEXT   20
c factor while
Guest on 11th July 2024 08:05:28 AM


  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n;
  5. printf("enter a number");
  6. scanf("%d",&n);
  7. int c=1;
  8. printf("Factors of %d\n",n);
  9. while (c<=n)
  10. {
  11. if (n%c==0)
  12. {
  13. printf("%d\n",c);
  14. }
  15. c=c+1;
  16. }
  17. return 0;
  18.  
  19.  
  20.  
  21. }

Raw Paste

Login or Register to edit or fork this paste. It's free.