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.

  1. Declare a variable named total.
  2. Assign the sum of num1 and num2 to this variable.
  3. Return the total variable.

01EXAMPLE 1

Inputnum1 = 15, num2 = 25
Output40

Explanation: 15 + 25 = 40

Constraints

  • Return the sum of the two parameters.
  • The return value must be a number.
FundamentalsVariablesArithmetic
JavaScript
Loading...
5 Hidden

Input Arguments

num115
num225

Expected Output

40

Click RUN to test your solution