basics · beginner · ~15 min

Sum of three

Combine several variables in an expression.

Challenge

Implement long sum3(int a, int b, int c) returning a+b+c as a long.

Starter code

long sum3(int a, int b, int c) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.