(this is dependon on compiler implementaion....)this is due to shortcircuit
implementaion of intermidiate code genaration phase of compiler..
please read Aho ullman book of compiler desgn to get more details.....

On Wed, Jun 15, 2011 at 12:51 AM, snehi jain <snehijai...@gmail.com> wrote:

>
> first it checks Q if that is NOT true then it computes R else it doesn't.
>
> this is the correct line .
>   On Tue, Jun 14, 2011 at 10:21 PM, snehi jain <snehijai...@gmail.com>wrote:
>
>> 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 <crazy.logic.k...@gmail.com>wrote:
>>
>>> hmm...someone explain...me too confused :(
>>>
>>>
>>> On Tue, Jun 14, 2011 at 9:14 AM, rahul dixit <dixit.rahu...@gmail.com>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 algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> 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 algogeeks@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> algogeeks+unsubscr...@googlegroups.com.
>>> 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 algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Thanks and Regards,
------------------------------
*DIPANKAR DUTTA*
Visiting Research Scholar
Dept of Computing,
Macquarie University, Sydney, Australia
ph.no-+61 2 98509079 ( Mon-Fri 10:15-7:00) Sydney time
email: dipankar.du...@mq.edu.au

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

Reply via email to