basics · beginner · ~15 min

Add two integers

Write and return from your first C function.

Challenge

C is a compiled language for computation. Implement int add(int a, int b) returning their sum.

Starter code

int add(int a, int b) {
    /* TODO */
    return 0;
}

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