c - Operator Precedence - Expression Evaluation -


I get the output as 1 for the following code snippets. I want to know how it came?

  zero main () {int x = 10, y = 20, z = 5, i; I = x's & lt; Y & lt; Z; Printf ("% d", i); }    

i = x & lt; Y & lt; Z; , i = (x & lt; y) & lt; Z is interpreted as which in turn i = 1 & lt; Z , which evaluates for 1.

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -