# how do i alternate from positive int and negative int in a number sequence

I am doing an assignment for university and I have to print out the first ten numbers of a number sequence which is 1, 2, 0, 3, -1, 4, -2.... I have worked out the rest of the sequence which is where you alternate adding a positive number and then a negative one for example to go from 1 to 2 you add the number one and then to go from 2 to 0 you add the number -2. But I cant quite get my head around how to alternate...

By: StackOverFlow - Thursday, 8 November

# Related Posts

- Older News
- Checking if sequence is almost strictly in ascending order StackOverFlow (3 days ago) - This was part of my interview questions.Given a sequence of integers as an array, I have to determine whether it is possible to obtain a strictly increasing sequence by removing...