Little Help for a beginner..

Hey guys
I am trying to program my arduino to make one number bigger with one and at the same time to make other number smaller with one.Here is my code

int a=1500;
int b;
void setup() 
{ 
  Serial.begin(9600);
  } 

void loop()  
{
  delay(1000);
  b=a;
 a++;
 if(a++)
 {
   b--;
 }
  Serial.print("I make it "); 
                Serial.println(b, DEC);
  }

could you tell me what i am doing wrong because i am receiving this:

I make it 1499
I make it 1501
I make it 1503
I make it 1505
and etc..

PS.Sorry for my bad english :slight_smile:

What did you expect to see?

1499 ,1498,1497.....

Why are incrementing a twice?

Can you explain your reasoning?

Simple approach.
Get a sheet of paper, draw two columns, one labelled 'a', the other labelled 'b'.
Write 1500 in the column labelled 'a', and zero in the column labelled 'b'.
Start from the top, and emulate the instructions in your sketch in your head.
Every time a variable is assigned, cross out the old value and write in the new.

See how that goes.

I saw my mistake .THX for the fast answer guys