Skip to content

Instantly share code, notes, and snippets.

@davidkayce
Created July 13, 2021 14:35
Show Gist options
  • Save davidkayce/4bcff43ed140ebbec31c9d0b95fbe2b0 to your computer and use it in GitHub Desktop.
Save davidkayce/4bcff43ed140ebbec31c9d0b95fbe2b0 to your computer and use it in GitHub Desktop.
// 1. Find sum of even numbers from n
function findSumEvenNumbers(num) {
let n = 0;
if(even(num)){
n = num/2
} else {
n = (num - 1)/2
}
return n*n + n
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment