Unexpected behaviour of blinking LED code
As Abhishek mentioned in his answer is correct, but the better way is to use for loops while dealing with many led's.

Let's say you have led's connected from pin 2 to 8.

int pin = 2;
void setup() 
{
   for (Pin = 2; Pin &lt; 8; Pin++) 
   {
     pinMode(Pin, OUTPUT);
   } 
}
void loop() 
{
   for (int Pin = 2; Pin &lt; 8; Pin++) 
   {
     digitalWrite(Pin, HIGH);
     delay(1000);
     digitalWrite(Pin, LOW);
     delay(1000);
    }
}