Modifyed blink

There is someone who knows where is the mistake. This is an arduino windows, the blink program modifyed to make only 100 bilnks. Thanks you very much.
Gives an Blink 19 error: expected unqualified-id before ‘while’

int led = 13;
int i = 0;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void while(i<100) {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
if (i>9) break;
i++;
}

while is not a function, so should not be qualified with void, but you do need a function called "loop()"

but I tryed with while without void and it does the same error.

That's because you didn't have a "void loop()" in front.. You can't have executable code that is not inside a function.

Because you need loop()

Mark

But how do I do a break outside a loop?

Do you mean function called "loop" or a while or for loop?

I mean a break outside a loop (not function), a "for", "while" etc, what admit a break sentence.

const uint8_t           pinLED      = 13;

const uint8_t           LED_OFF     = LOW;
const uint8_t           LED_ON      = HIGH;
const unsigned long     HALF_SECOND = 500UL;


void loop()
{}

void setup()
{
    pinMode(pinLED, OUTPUT);     

    digitalWrite(pinLED, LED_OFF;

    int     loop_counter = 100;
    while ( loop_counter-- )
    {
        digitalWrite(pinLED, LED_ON);
        delay(HALF_SECOND);

        digitalWrite(pinLED, LED_OFF);
        delay(HALF_SECOND);
    }
}

Thank you, It's a bad habit inherited of BASIC programation.