542.Write and Reuse an Add Function
Easy
Given three integers
a, b and c, return their sum — and practise doing it with a helper function you write yourself.
A functionFunctionA named, reusable block of code. It receives inputs through parameters and sends a result back with return. packages one job so it can be used again and again. Here the job is "add two numbers". The values passed in a call are its argumentsArgumentsThe actual values given to a function when it is called, e.g. the 4 and 7 in addTwo(4, 7).; inside the function they are received by its parametersParametersThe named inputs in a function definition, e.g. x and y in addTwo(int x, int y).. Calling the same helper twice, with different arguments, adds all three numbers.
Example 1:
Input: a = 4, b = 7, c = 10
Output: 21
Example 2:
Input: a = -5, b = 5, c = 3
Output: 3
+ 4 hidden test cases run on Submit.
Constraints:
- ●
-100000000 ≤ a, b, c ≤ 100000000
a =
4
b =
7
c =
10