diff --git a/labs/L08/loop-arith.js b/labs/L08/loop-arith.js new file mode 100644 index 0000000..294759d --- /dev/null +++ b/labs/L08/loop-arith.js @@ -0,0 +1,17 @@ +function plus(a,b) { + for (let i=0; i < a; i++){ + b++; + } + return b; +} + +function mult(a,b) { + sum=0; + for(let i=0; i < a; i++) { + sum = plus(sum, b) + } + return sum; +} + +exports.plus = plus; +exports.mult = mult; \ No newline at end of file