Close
Close

What would be the output of: printf("%d\n",1==5==5); also mention the wrking plzz

   jenny_uppal_1722


Answers

  •   

    It will print 0 because == operator is used to check if its left-hand side operand is equal to right-hand side operand. Since 1 is not equal to 5, so the condition became false and thus printed 0.


    • miss aakhya so that means !! the operation checks 1st 1st equal to 5 or not??? and then it gives result o and then it checks 0 is equal to 1 or not??? right?? is it the way of wrking?? plzz reply
      - jenny_uppal_1722
    • miss aakhya so that means !! the operation checks 1st 1 equal to 5 or not??? and then it gives result o and then it checks 0 is equal to 1 or not??? right?? is it the way of wrking?? plzz reply
      - jenny_uppal_1722
    • == operator checks equality from left to right. So, first it will check the condition '1==5' which is 0 and then it will check the condition '0==5' which is also false hence returning 0.
      - Aakhya Singh

Ask Yours
Post Yours
Write your answer