[Challenge] Multiply 2 numbers without ‘+-*/’ operators and ‘for’ and ‘while’ keywords

Following on the previous challenge, I thought of doing a similar challenge but for multiplication.

Can you multiply 2 numbers without using the following operators and keywords?

Rules:

Multiply a and b
Don’t use operators: +-*/
Don’t use keywords…


This content originally appeared on DEV Community and was authored by Keff

Following on the previous challenge, I thought of doing a similar challenge but for multiplication.

Can you multiply 2 numbers without using the following operators and keywords?

Rules:

  • Multiply a and b
  • Don't use operators: +-*/
  • Don't use keywords: for/while

Pseudocode:

a = 2
b = 32

multiply(a, b) => 64

Test:

multiply(a, b) == a * b

You can use any language you want, additionally you can add a note indicating which language it is, so people not familiar with the language can know!

That's all, have fun!!

My solution:


This content originally appeared on DEV Community and was authored by Keff


Print Share Comment Cite Upload Translate Updates
APA

Keff | Sciencx (2022-07-11T11:13:14+00:00) [Challenge] Multiply 2 numbers without ‘+-*/’ operators and ‘for’ and ‘while’ keywords. Retrieved from https://www.scien.cx/2022/07/11/challenge-multiply-2-numbers-without-operators-and-for-and-while-keywords/

MLA
" » [Challenge] Multiply 2 numbers without ‘+-*/’ operators and ‘for’ and ‘while’ keywords." Keff | Sciencx - Monday July 11, 2022, https://www.scien.cx/2022/07/11/challenge-multiply-2-numbers-without-operators-and-for-and-while-keywords/
HARVARD
Keff | Sciencx Monday July 11, 2022 » [Challenge] Multiply 2 numbers without ‘+-*/’ operators and ‘for’ and ‘while’ keywords., viewed ,<https://www.scien.cx/2022/07/11/challenge-multiply-2-numbers-without-operators-and-for-and-while-keywords/>
VANCOUVER
Keff | Sciencx - » [Challenge] Multiply 2 numbers without ‘+-*/’ operators and ‘for’ and ‘while’ keywords. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/07/11/challenge-multiply-2-numbers-without-operators-and-for-and-while-keywords/
CHICAGO
" » [Challenge] Multiply 2 numbers without ‘+-*/’ operators and ‘for’ and ‘while’ keywords." Keff | Sciencx - Accessed . https://www.scien.cx/2022/07/11/challenge-multiply-2-numbers-without-operators-and-for-and-while-keywords/
IEEE
" » [Challenge] Multiply 2 numbers without ‘+-*/’ operators and ‘for’ and ‘while’ keywords." Keff | Sciencx [Online]. Available: https://www.scien.cx/2022/07/11/challenge-multiply-2-numbers-without-operators-and-for-and-while-keywords/. [Accessed: ]
rf:citation
» [Challenge] Multiply 2 numbers without ‘+-*/’ operators and ‘for’ and ‘while’ keywords | Keff | Sciencx | https://www.scien.cx/2022/07/11/challenge-multiply-2-numbers-without-operators-and-for-and-while-keywords/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.