Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active January 18, 2022 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save McLarenCollege/9a95802bb5b9cbba5897afcbad6b1e0b to your computer and use it in GitHub Desktop.
Save McLarenCollege/9a95802bb5b9cbba5897afcbad6b1e0b to your computer and use it in GitHub Desktop.
Exercise Name : Average Of Three Numbers

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);

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

Calculate the average of 30, 25, 35.

Now calculate the average of -5, 10, -26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment