The return statement is used to immediately return from the current function. It is illegal outside of the body of a function definition. If the function returns a value then the return statement must be accompanied by a return value of the correct type.

Example 7.9. return syntax

int difference(int a, int b)
    // Must return a value regardless of the control path taken
    if(a < b)
        return b - a;
        return a - b;