function summedValue = SummationWithLoop(userNum)x=1:1:userNum;xSum=0;k=1;while (xSum<=userNum) xSum = xSum+x(k); k=k+1;end
function summedValue = SummationWithLoop(userNum)x=1:1:userNum;xSum=0;k=1;while (xSum<=userNum) xSum = xSum+x(k); k=k+1;end
Best Answer