about | help | code help+videos | done | prefs |
Using the following mathematical fact, a * b = a * (b - 1) + a define a recursive function that when passed two integers, returns their product without using the * operator or any loops. multiplyRecursive(10, 500) → 5000 multiplyRecursive(-19, 2) → -38 multiplyRecursive(10, -5000) → -50000 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 3 Post-solution available
Copyright Nick Parlante 2017 - privacy