X268: Recursion Programming Exercise: Add odd values

For function addOdd(n) write the missing recursive call. This function should return the sum of all postive odd numbers less than or equal to n.

Examples:

addOdd(1) -> 1
addOdd(2) -> 1
addOdd(3) -> 4
addOdd(7) -> 16

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.