let tamil = 50;
let english = 55;
let maths = 50;
let science = 50;
let socialScience = 50;
function add() {
let total = tamil + english + maths + science + socialScience;
return total;
}
let total = add();
console.log(total);
function avg(total) {
return total / 5;
}
let average = avg(total);
console.log(average);
function grade(avrg) {
if (avrg >= 90) {
console.log("A");
}
else if (avrg >= 70) {
console.log("B");
}
else if (avrg >= 50) {
console.log("E");
}
else {
console.log("Failed")
}
}
grade(average);
Output :
255
51
E
Top comments (0)