fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i = 3;
  6. int j = 365;
  7. int count = 0;
  8. int product = 0;
  9.  
  10. while(product<j)
  11. {
  12. product += i;
  13. count ++;
  14. }
  15.  
  16. count --; //we overshoot j, so lets subtract 1
  17.  
  18. printf("%d goes into %d wholly %d times", i, j,count);
  19. return 0;
  20. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
3 goes into 365 wholly 121 times