Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This challenge activity uses a 3rd party app. Though your activity may be record

ID: 3938121 • Letter: T

Question

This challenge activity uses a 3rd party app. Though your activity may be recorded, a refresh may be required to update the banner to the left. Write a for loop that assigns summed Value with the sum of all odd values from 1 to user Num. Assume user Nume is always greater than or equal to 1. Ex: If user Num is 5. then summed Value is 9 (i.e. 1 + 3 + 5 = 9). function summed Value = Odds Sum(user Num) summed Value = theta; % Write a for loop that assigns summed Value with the % sum of all odd values from 1 to user Num

Explanation / Answer

function summedValue = Oddssum(userNum)
    summedValue = 0
    for k = 1:2:userNum
        summedValue=summedValue+k;
        k = k+2;
    end
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote