why is "if " statement not working?

hay guys
i know i must be doing something stupid here but for the life of me, i can't see it.
The action in the IF statement seems to b activated every cycal although the condition isnt being met! what am i missing here?

thanks

int inc = 20; 


void setup() {
}

void loop()
{
   for (int i =40; i<1000 ; i=i+inc){


if (i<=0 || i >= 1000);{
  (inc = -inc);
}
Serial.print("i =   ");
Serial.println(i);
Serial.print("inc = ");
Serial.println(inc);
delay(10);
}
}
if (i<=0 || i >= 1000);{

the ; should not be there

Lose the semicolon at the end of the if staement. A semicolon there ends the if.

thanks guys

I'm curious about why you even have that if statement there to begin with, since it will never be true inside that for loop.

And you also missed initializing the serial monitor. Add "Serial.begin(9600);" in void setup().

You also might start using the IDE Tools->Autoformat from time to time. It would have given you a clue about that ;.