Add two numbers
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
Loading the editor…
Run the tests to check your solution.