This challenge activity uses a 3rd party app Though your act
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
Solution
function summedValue = Oddssum(userNum)
summedValue = 0
for k = 1:2:userNum
summedValue=summedValue+k;
k = k+2;
end
end
