Total Calculator
EasyAcc. 98.5%
+10 XP 5
Calculating Totals
In everyday calculations, adding two values is common, like calculating the total marks of a student. Variables act as storage containers where we can save our final result.
The Assignment
Your function receives two numbers, num1 and num2.
- Declare a variable named
total. - Assign the sum of
num1andnum2to this variable. - Return the
totalvariable.
01EXAMPLE 1
Input
num1 = 15, num2 = 25Output
40Explanation: 15 + 25 = 40
Constraints
- Return the sum of the two parameters.
- The return value must be a number.
FundamentalsVariablesArithmetic
JavaScriptSystem handles I/O — write your function only
Loading...
5 Hidden
Input Arguments
num115
num225
Expected Output
40
Click RUN to test your solution