DEV Community

Joel Nahabwe
Joel Nahabwe

Posted on

some help guys! i need the total

let MTC = window.prompt("Enter marks for MTC:");
let ENG = window.prompt("Enter marks for ENG:");
let SST = window.prompt("Enter marks for SST:");
let SCI = window.prompt("Enter marks for SCI:");
let marks = [MTC, ENG, SST, SCI];
let total = 0;
for(let sum = 0; sum < 4; sum++){
total += marks[sum];
}
console.log(total);

Top comments (0)