Ok so im trying to make a program and i need to have the counter start at -3 and go down by 2, but every other number has to be a positive: for example:
-3, 5, -7, 9, -11, 13, -15, 17, -19,...
any input?
I made a successful program but i feel like this is not very efficient.
while ("expression")
{
if (j % 4 == -1) //checks if number should be negative
j = Math.abs(j);
if (j > 0) //makes counter a negative
j = -j;
j -= 2; //goes down by 2
}