The missing key

themissingkeyThe aim of this challenge is to write a computer program that will take two whole numbers (integers) as input and output the result of multiplying these two numbers together. However, to make this task more challenging, you have to assume the * key of your keyboard is broken or missing and hence you are not allowed to use the * operator in your code.

You can complete your code in the trinket below:

Hint?


View Hint #1
5 * 4 = 5 + 5 + 5 + 5
7 * 6 = 7 + 7 + 7 + 7 + 7 +7
8 * 3 = 8 + 8 +8
View Hint #2
Use a loop!

Did you like this challenge?

Click on a star to rate it!

Average rating 2.4 / 5. Vote count: 48

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!

Tagged with: