← The Compilation Pipeline & Reading Compiler Errors

Fix: Argument Mismatch

hard

clamp restricts value to the range [lo, hi], and it’s already implemented correctly. The bug is entirely at the call site in main, which reads all three inputs but only passes two of them through to clamp.

Submit this as-is and read the error before fixing it – it’s a different flavor from both previous exercises: not a syntax error (the code parses fine) and not a link error (the function is defined) but a compile-time argument mismatch, caught because the compiler can see the function’s declared signature and this call site in the same file.

Your solution

"Run" uses the sample stdin ("15 0 10"). "Submit" checks your code against all 3 test cases.

Test results

Submit your solution to run it against all test cases.

Hints

    Reference solution