Skip to content

Add

Write a function that returns the sum of two numbers.

Example

For param1 = 1 and param2 = 2, the output should be

add(param1, param2) = answer

Chart

Solution

py
def add(param_1, param_2):
    return param_1 + param_2


print(add(1, 2))
js
function add(param1, param2) {
  return param1 + param2;
}

console.log(add(1, 2));
ts
function add(param1: number, param2: number): number {
  return param1 + param2;
}

console.log(add(5, 2));
cs
using Internal;

static int add(int a, int b)
{
  return a + b;
}

Console.WriteLine($"{add(1, 2)}");

my thoughts are neither my employer's nor my wife's