fork download
  1. #include <iostream>
  2. using namespace std;
  3. int mult(int x, int y) {
  4.  
  5. int result;
  6.  
  7. result = 0;
  8.  
  9. while (y != 0) {
  10. result = result + x;
  11.  
  12. y = y - 1;
  13.  
  14. } return (result);
  15.  
  16. }
  17.  
  18. int main()
  19.  
  20. {
  21.  
  22. int x = 9, y = 6; cout << mult(x, y);
  23.  
  24. return (0);
  25.  
  26. }
Success #stdin #stdout 0.01s 5372KB
stdin
Standard input is empty
stdout
54