Ask Question
9 January, 16:45

function summedValue = SummationWithLoop (userNum) % Summation of all values from 1 to userNum summedValue = 0; i = 1; % Write a while loop that assigns summedValue with the % sum of all values from 1 to userNum end

+2
Answers (1)
  1. 9 January, 16:49
    0
    function summedValue = SummationWithLoop (userNum)

    % Summation of all values from 1 to userNum

    summedValue = 0;

    i = 0;

    % use a while loop that assigns summedValue with the

    % sum of all values from 1 to userNum

    while (i < = userNum)

    summedValue = summedValue + i;

    i = i + 1;

    end

    end
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “function summedValue = SummationWithLoop (userNum) % Summation of all values from 1 to userNum summedValue = 0; i = 1; % Write a while loop ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers