Exercise · Your First Program · lesson 7 of 7
Exercise: your first function
Write two functions: int square(int x) returns the square of x, and int sum3(int a, int b, int c) returns the sum of three numbers.
square(3)→9square(-4)→16sum3(1, 2, 3)→6
Constraints: the numbers are any int values for which the result also fits in an int.
The "Run tests" button runs the checks from the first_test.cpp tab—you can read them but not change them.