Ask Question
6 February, 16:22

Give a recursive algorithm for finding the sum of the

first n odd positive integers.

+4
Answers (1)
  1. 6 February, 17:39
    0
    I'm writing that in some sort of pseudocode; if you don't understand it, feel free to ask for more details in the comments.

    function sumOdd (n)

    if n==1 then

    return 1

    end if

    return (sumOdd (n-1)) + (n*2-1)

    end function
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Give a recursive algorithm for finding the sum of the first n odd positive integers. ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers