CJCoding With Joseph
15free / daySign inCreate account

Compose Two Functions

Modular programming means breaking a job into small reusable functions. Write two functions:

1) int triple(int n) that returns n * 3.
2) int tripleSum(int a, int b) that returns the sum of tripling each value. It must CALL triple(...) 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
Topics:
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.