This program takes 2 pair of numbers and we first add them and then multiply them. For example 11 and 11 = 4 because (1 + 1) * (1 + 1) = 4.
Code (Run Code) :
// This program takes 2 pair of numbers and we first add them and then multiply them. For example 11 and 11 = 4 because (1 + 1) * (1 + 1) = 4
function addMulSeries() {
var arr = [];
var num = [];
for (var i = 1; i < 11; i++) {
arr.push(i);
}
for (i of arr) {
num.push((i + i) * (i + i));
}
document.write(num);
}
addMulSeries();
No comments:
Post a Comment