Okay so here is what I am trying to solve
.
Write a function that computes the alternating sum of all elements in an array. For example, if alternating_sum is called with an array containing
1 4 9 16 9 7 4 9 11
then it computes
1 – 4 + 9 – 16 + 9 – 7 + 4 – 9 + 11 = –2
It seems to get stuck when I try to quit the inputs. If understands then please let me know.