basics · beginner · ~15 min

Triple a value

Implement a function matching a declared prototype.

Challenge

Header files declare functions other files implement. Implement int triple(int n) returning 3*n.

Starter code

int triple(int n) {
    /* TODO */
    return 0;
}

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