Sum using Return Value

You are given two integers A and B .

Create a function named add that takes two integer as parameters and returns the sum of those two integers i.e. A and B.

Note: The function must return the result, not print it directly.

  • You do not need to take the integers as Input, driver code will take the input and fetch it to function add.

Example 1:

Input: A = 10, B = -1

Output: 9

Example 2:

Input: A = 5, B = -10

Output: -5

Now Your Turn!

Pick the correct output for the given input

Input: A = -5, B = -10

Still unsure what the problem is asking ?

Let’s go through a few more examples, step by step, to make it clearer.

Constraints:

  • -100 <= A, B <= 100
0
//your code goes here
Test Case

Input:

A
B