# 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
- Library to control program sequence with GUI elements StackOverFlow (Yesterday) - I am currently working on a tool to automate mass objects in a certain system. The system is not important to know.Is there any library to solve these problems:Provide a...
- Removes the last two digits of a positive integer base 10 number that is greater than 99 in java StackOverFlow (2 days ago) - My homework question is :Removes the last two digits of a positive integer base 10 number that is greater than 99* @param n* a positive integer number greater than 99*...
- Print factors from 1 t0 100 in java and display their factors in terms of literals but not in terms of numbers StackOverFlow (3 days ago) - The program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fullybelow. The program may contain multiple methods,...