CrazyEngineers
  • Try to solve this conflict.

    Updated: Oct 25, 2024
    Views: 1.0K
    It's my java examination question.
    a=10,b=12;
    Calculate the value of a&b and a&&b.
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • silverscorpion

    MemberAug 5, 2010

    a & b = 8

    a = 10 = 1010
    b = 12 = 1100

    So, a & b is bitwise and, which comes to 1000 which is 8


    a && b is logical and. Since both operands are non zero, the result in 1.
    Are you sure? This action cannot be undone.
    Cancel
  • vinsocorp

    MemberAug 7, 2010

    a&b is 8.a&&b is 1...
    Are you sure? This action cannot be undone.
    Cancel
  • Morningdot Hablu

    MemberAug 7, 2010

    You both are correct.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register