Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 486 Bytes

average-of-three-numbers.md

File metadata and controls

22 lines (18 loc) · 486 Bytes

Average of three numbers

Write a function named averageOf3 that takes three numbers as parameters and returns the average of the three numbers.

// write your function here

let avg1 = averageOf3(30, 25, 35);
console.log(avg1);

let avg2 = averageOf3(-5, 10, -26);
console.log(avg2);

Here is an example of a function

function square(num){
   let squareOfNum = num * num;
   return squareOfNum;
}
let result = square(5);
console.log("The square is " + result);