about | help | code help+videos | done | prefs |
alternate_add
Write a function to alternately add and subtract integer values from 1 to n. For example, alternate_add(5) = 1 - 2 + 3 - 4 + 5 = 3 alternate_add(3) → 2 alternate_add(5) → 3 alternate_add(8) → -4 ...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