Recent Posts

Pages: 1 2 [3] 4 5 6 7 8 ... 10
21
Micro-IDE / Re: Using logical OR in a while statement?
« Last post by Espallator on August 28, 2010, 07:57:14 am »
Quote
Can I use the logical OR operator in a while statement? How?
I tried like:
while(c != \'1\' || c != \'2\')
{...}
or
while((c != \'1\')||(c != \'2\'))
{...}


but it doesn\'t work. The weird thing is that
while(c != \'1\')
{...}

it works!

I solved it! I just changed || for && and its working. ;D
22
Micro-IDE / Using logical OR in a while statement?
« Last post by Espallator on August 21, 2010, 07:54:30 am »
Can I use the logical OR operator in a while statement? How?
I tried like:
while(c != \'1\' || c != \'2\')
{...}
or
while((c != \'1\')||(c != \'2\'))
{...}


but it doesn\'t work. The weird thing is that
while(c != \'1\')
{...}

it works!
Pages: 1 2 [3] 4 5 6 7 8 ... 10