ok i got it is the precedence of *= is less than of +

On Wed, May 25, 2011 at 3:52 PM, Shachindra A C <[email protected]>wrote:

> 1st print  : x = x * (3 + 2) -> 10
> 2nd print : x = x * 4 -> 40 : while evaluating the expression, the
> rightmost result will be used
> 3rd print :  x = (4 == 4)  -> 1
> 4th print : x == ( y = z ) evaluates to false; prev val of x, 1 is printed
>
> On Wed, May 25, 2011 at 3:35 PM, sourabh jakhar 
> <[email protected]>wrote:
>
>>
>> #include<stdio.h>
>> #include<stdio.h>
>> #include<conio.h>
>> #define PRINTX printf("%d\n",x)
>> main()
>> {
>>     int x=2,y,z;
>>     x*=3 + 2; PRINTX;
>>     x*= y = z = 4; PRINTX;
>>     x = y == z; PRINTX;
>>     x == ( y = z ); PRINTX;
>> getch();
>> }
>> can anyone explain the output
>>
>> --
>> SOURABH JAKHAR,(CSE)(3 year)
>>
>>
>> The Law of Win says, "Let's not do it your way or my way; let's do it the
>> best way."
>>
>>  --
>> 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.
>>
>
>
>
> --
> Regards,
> Shachindra A C
>
>  --
> 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.
>



-- 
SOURABH JAKHAR,(CSE)(3 year)
ROOM NO 167 ,
TILAK,HOSTEL
'MNNIT ALLAHABAD

The Law of Win says, "Let's not do it your way or my way; let's do it the
best way."

-- 
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