What is ~ operator in C.

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 4

  • @sucharithapuvvada8076
    @sucharithapuvvada8076 4 ปีที่แล้ว

    Sir storage classes topic ki some questions evvandi

    • @CSEGURUS
      @CSEGURUS  4 ปีที่แล้ว

      yea... i vl do it soon. For static storage class, u can watch Q.no 51 to 54 in the following video link.
      th-cam.com/video/EmYvmSoTZko/w-d-xo.html

  • @opst1704
    @opst1704 4 ปีที่แล้ว

    -11
    How to calculate in head quickly.
    10 is 000...0001010 in binary.
    ~ BITWISE Operator turns all zeros into ones, and ones into zeros, so
    ~10 is 11111...110101.
    So how to convert this binary number into decimal?
    Well, last bit is INT_MIN -2147483648, and all other bits are positive 2147483647, so
    1111...11111 is actually -1.
    Anyway, now we just subtract 8 and 2, because our binary number is 1111..1110101.
    and we'll get:
    -1-8-2 = -11