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

Keff - Jul 11 '22 - - Dev Community

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
Enter fullscreen mode Exit fullscreen mode

Test:

multiply(a, b) == a * b
Enter fullscreen mode Exit fullscreen mode

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:

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .