Hi i have a question if anybody can help me. I need to take a positive input, n, and and produce an output that is the sum of the alternating series.
i.e. n=5 the nthe output would be 3 because 1 - 2 + 3 - 4 + 5 = 3
i need to do this using a for loop and it has been boggling my mind.
Any suggestions on how i can get this done? Just the for loop i dont understand, like, how to turn the even numbers negative.