Multiplication without using "*".
For a quick Coding challange, you can try doing Multiplication without using the multiply operator, or any thing that multiplies for you. Since this is quite simple, you can try for floating numbers as well.
This is not restrictive enough. As a / (1/b) === a * b Therefore you could just let answer = a / (1/b).
This is not restrictive enough. As
a / (1/b) === a * bTherefore you could justlet answer = a / (1/b).
Alright, doing multiplication without using the "*" symbol, or the "/" symbol, or using anything that uses * or / to do any calculation.
This is not restrictive enough. As
a / (1/b) === a * bTherefore you could justlet answer = a / (1/b).Alright, doing multiplication without using the "*" symbol, or the "/" symbol, or using anything that uses * or / to do any calculation.
It makes more sense to limit it to the + and - operations. That way there is no way to use some built in function.
Isn't it simple enough like, a*b simply means "a added b number of times" so one could easily use a loop and + operator to get the job done.
Isn't it simple enough like, a*b simply means "a added b number of times" so one could easily use a loop and + operator to get the job done.
True, but that doesn't exactly work the same for floating point numbers. That's the coding challenge idea to figure a way out for decimals.