about | help | code help+videos | done | prefs |
sumOfEvenSquares
When both arguments are even, calculate and return the sum of the squares. When one value is odd, use double the square of the other even value. When both values are odd, return 0. Hint: Checking for even and odd can be tricky with negative numbers. The opposite of a%2==0 is not a%2==1. sumOfEvenSquares(-2, 4) → 20 sumOfEvenSquares(1, 2) → 8 sumOfEvenSquares(-1, 2) → 8 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy