EmbLogic's Blog

operators

how could the compiler compile the following statement

z >= y >= x ? 1 : 0

3 Responses to operators

  1. Paras sharma says:

    values of x=3,y=z=4;
    first:z>=y–>T(1)
    then :1>=3–>f(0)
    o/p—->0
    :)

    • Pushpa says:

      if we check the associativity of >= operator,its left to right.Evaluation of expression should start from z>=y which is true ,so result of z>=y is 1 ..
      then 1>=x(3) will be checked which is false
      hence o/p will be 0

Leave a Reply to Kuldeep Dhanotia Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>