that is what is happening here
m = ++i || (++j && ++k);

in C if       P = Q || R;

first it checks Q if that is NOT true then it computes C else it doesn't.

++ is a unary operator so before the || and && operations can happen
increment will take place. This justifies the higher precedence of ++
operator.

in the above example  i gets incremented to -2 first and then || operation
is executed. i has a non-zero value therefore no computation is done for
(++j && ++k); .

keep initial value of i to -1 then  after m = ++i || (++j && ++k);
statement
i = 0 , j = 3 , k =1 and m =1





On Tue, Jun 14, 2011 at 10:02 PM, nicks <[email protected]> wrote:

> hmm...someone explain...me too confused :(
>
>
> On Tue, Jun 14, 2011 at 9:14 AM, rahul dixit <[email protected]>wrote:
>
>>
>> bt increment operator has the higher precedence than || and &&
>> so all the variables should be incremented  first then && and then ||
>> should  be evaluated
>> then how it is happening.plz explain
>>
>>
>> rahul dixit
>> Du-Mca
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to