Please explain the evalution of this expression...!

TheV

TheV

@thev-iGmS6y Oct 26, 2024
int i=2;

int j=4;

int k=i++>j&2;

What is the value in k...???

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • born_star16

    born_star16

    @born-star16-U2z3az Sep 5, 2011

    According to me value of k will be 1.
  • simplycoder

    simplycoder

    @simplycoder-NsBEdD Sep 6, 2011

    I think k will be 0.
    This is my analysis.
    relational preceeds over bitwise operator.
    current value of i=2 and j is 4
    so i>j will be 0
    0&2 will be 0
    this will make k=0.