Babanna Duggani Babanna Duggani - 1 year ago 122
C Question

Operator Precedence - Expression Evaluation

For the following code snippet I get the output as

. I want to know how it came?

void main()
int x=10,y=20,z=5,i;

yan yan
Answer Source

i=x<y<z;, gets interpreted as i=(x<y)<z, which in turn gets interpreted as i=1<z, which evaluates to 1.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download