← Back to Modular Programming
Question 179
Compose Two Functions
Compose Two Functions
Modular programming means breaking a job into small reusable functions. Write two functions: 1) inttriple(int n)that returns n * 3. 2) inttripleSum(int a, int b)that returns the sum of tripling each value. It must CALLtriple(...)instead of multiplying by 3 again. Do NOT write a main function.
Expected Output:
15 27
= newline. The output ends with a newline — print one after the last line.
Hints4 available
Sign in to use hintsTopics:
Modular Programming
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.