functiongetSum (num1,num2) {

  1. varsum1 = num1 + num2;<br /> varsum2 = 0;<br /> for (i = num1; i <= num2; i++) {<br /> sum2 += i;<br /> }<br /> console.log(num1 + ',' + num2 + '的和为' + sum1);<br /> console.log(num1 + ',' + num2 + '的累加和为' + sum2);<br /> }<br /> getSum(1,100);

.