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

Respuesta :

Answer:

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