Created
July 13, 2021 14:35
-
-
Save davidkayce/4bcff43ed140ebbec31c9d0b95fbe2b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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