a problem with FOR()

I did a simple code to practice FOR()
At the moment of verify, the code don’t have problems. But when I upload it, it doesn’t work in the arduino.

THIS IS THE CODE.

int pin=11;
void setup()
{
for( pin ; pin <= 13 ; pin++);
pinMode(pin,OUTPUT);
}

void loop()
{
for( pin ; pin <= 13 ; pin++);
{
digitalWrite(pin,HIGH);
delay(500);
digitalWrite(pin,LOW);
delay(500);
}
}

Turn on warnings in the IDE.

Same problem, same solution.

What is the value of pin at the start of the for loops ?

Another issue is that pin is declared as a globar var…

UKHeliBob:
What is the value of pin at the start of the for loops ?

And turning on Warnings flags this.

Goet:
Another issue is that pin is declared as a globar var...

That's not a problem, if the variable is initialised correctly.

AWOL:
That's not a problem, if the variable is initialised correctly.

...and it is if not, as the code shows...

Goet:
...and it is if not, as the code shows...

Nope. It isn't a problem. Not best practices, but NOT a problem.

Not initializing pin is the one and only problem.

What are you saying guys…
pin will reach the value of 14 once the for loop in the “setup” method is finished, therefore for loop in “loop” method will be skipped, as the condition to stay is pin <= 13.
And I bet you know : )
Ok, it’s not the only reason why it’s not working, but it just doesn’t make sense… can we classified it as a “problem”?

There is another HUGE problem right at the end of the for line. He has an empty for loop.

pin is initialized at global scope so if the for loop didn't have that extra character at the end the first one would run fine. But after that pin would be 14 and the one in loop would never run.

OP needs to read the forum rules and post code properly and then he needs to look at an example of a for loop and see what he added that shouldn't be there.