CodeMIRAI
0 XP

Add two numbers

Easy +30 XP Solved

Read two numbers, one per line, and print their sum with console.log.

In CodeMIRAI challenges, prompt() returns the next line of input as a string, so convert it with Number().

Input
3
4
Expected output
7
Input
-10
2.5
Expected output
-7.5
Show a hint

prompt() returns a string. "3" + "4" is "34"; Number("3") + Number("4") is 7.

Show a solution
JavaScript
Loading the editor…
Run the tests to check your solution.