a counter code question

Hi guys,

how do i write:

while (counter is equal to 5 or 6)
{
}

would i just write

while (counter = 5,6)
{
}

cheers,

while ( (counter == 5 ) || (counter == 6) )
{
}

|| - means a logical OR

&& - means a logical AND

while (counter == 5 || counter ==6) {
}

EDIT:
@robtillaart: You win me for 21s! :slight_smile: Why you add the extra brackets? You don't need it but maybe you had a reason.

thats great cheers, guys