[Solved] How to simulate multiplication by addition java
The code you have: sum = 0; while (sum < a + b) { sum += a; } will only add a to the sum until the sum becomes a + b. You would need to use a * b in the while loop in that case but, as stated, you’re not allowed to. Since … Read more