C bitwise operators 🔣

แชร์
ฝัง

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

  • @BroCodez
    @BroCodez  2 ปีที่แล้ว +35

    #include

    int main()
    {
    // BITWISE OPERATORS = special operators used in bit level programming
    // (knowing binary is important for this topic)
    // & = AND
    // | = OR
    // ^ = XOR
    // > right shift
    int x = 6; // 6 = 00000110
    int y = 12; // 12 = 00001100
    int z = 0; // 0 = 00000000
    z = x & y;
    printf("AND = %d
    ", z);
    z = x | y;
    printf("OR = %d
    ", z);
    z = x ^ y;
    printf("XOR = %d
    ", z);
    z = x > 2;
    printf("SHIFT RIGHT = %d
    ", z);
    return 0;
    }

    • @namansalgotra6293
      @namansalgotra6293 ปีที่แล้ว +1

      What software do you use?

    • @Abon963
      @Abon963 11 หลายเดือนก่อน +1

      ​@@namansalgotra6293If you are talking about where he writes the code it’s "Vs code"

  • @tomsterbg8130
    @tomsterbg8130 ปีที่แล้ว +26

    This was very easy to understand and while being really descriptive, thank you so much for making that video!

  • @sevanthishekar4379
    @sevanthishekar4379 2 หลายเดือนก่อน +12

    Quick Note: For Shift Left, like Bro mentioned there's a pattern.....every time you shift it, it doubles.
    Ex: int x = 6;
    for x

    • @spacewizerd
      @spacewizerd หลายเดือนก่อน

      thats cool
      thx man

  • @guillaumelacroix8730
    @guillaumelacroix8730 ปีที่แล้ว +10

    you are a legend mate! Thank you for this clear explanation!

  • @Garrison86
    @Garrison86 2 ปีที่แล้ว +2

    Awesome thanks for the demo on bit wise operators, super easy to understand 👍👍👍👍

  • @ronalbocher4159
    @ronalbocher4159 5 หลายเดือนก่อน

    Thank you so much! Extremely clear, amazing explanations!

  • @Mathieuny
    @Mathieuny 28 วันที่ผ่านมา

    Thanks for the video. Very understandable, good to get me started :)

  • @jacksoncobb2860
    @jacksoncobb2860 ปีที่แล้ว

    Super helpful video! Thank you!

  • @Abon963
    @Abon963 11 หลายเดือนก่อน

    Thanks!You made it very much easier

  • @arnavtripathiyo
    @arnavtripathiyo 3 หลายเดือนก่อน +1

    Thank you so much very easy to understand because of your video

  • @SuperIL12
    @SuperIL12 2 หลายเดือนก่อน

    Excellent! Perfect explanation!

  • @nataaalia
    @nataaalia 5 หลายเดือนก่อน

    Such a good explanation

  • @xbaleks4609
    @xbaleks4609 10 หลายเดือนก่อน +13

    better than a course that i bought (74.99$) on udemy...
    Thank you, very clear and understandable.

    • @MerrowGula
      @MerrowGula หลายเดือนก่อน

      you know that the udemy courses have discounts right ?

  • @sais640
    @sais640 6 หลายเดือนก่อน

    thanks bro code for the helpful tips :) and to everyone have fun programming

  • @cd-stephen
    @cd-stephen ปีที่แล้ว

    Bro!!!!! You are awesome and thank you

  • @mortenlund1418
    @mortenlund1418 9 หลายเดือนก่อน

    thx and great style

  • @user-lr9uo7fv8r
    @user-lr9uo7fv8r ปีที่แล้ว

    BIG LIKE!

  • @ansoncheng6418
    @ansoncheng6418 หลายเดือนก่อน

    Thank you for this

  • @MonirsOfficial
    @MonirsOfficial 5 หลายเดือนก่อน

    Masterpiece❤

  • @pemudahijrah2454
    @pemudahijrah2454 6 หลายเดือนก่อน +15

    So bassically 12&6 is equal to 6&12 is it?

  • @dredogu06
    @dredogu06 2 ปีที่แล้ว +1

    Thanks bro

  • @CoffeeDump
    @CoffeeDump 11 วันที่ผ่านมา

    i finally know what this operators means, thanks.

  • @indigo_diary
    @indigo_diary 9 หลายเดือนก่อน

    Thank you so much :)

  • @usurpvision
    @usurpvision 4 หลายเดือนก่อน

    Ok cool thanks my reference book did not explain shifts very well.

  • @antoinebguitar2869
    @antoinebguitar2869 3 หลายเดือนก่อน +2

    Oh so those scary looking math equations are actually just logic gates and boolean algebra lol

  • @BARATHBSIT
    @BARATHBSIT 2 ปีที่แล้ว

    Your a real programmer 😎

  • @corkicorgi
    @corkicorgi 5 หลายเดือนก่อน

    Ty :)

  • @Dexterdevloper
    @Dexterdevloper 3 หลายเดือนก่อน

    Thanks.

  • @aymanmouhcine5749
    @aymanmouhcine5749 ปีที่แล้ว

    Thank you

  • @bowa
    @bowa 6 หลายเดือนก่อน

    King!

  • @itsrmbaby
    @itsrmbaby 4 หลายเดือนก่อน

    شكرا

  • @hemozone9726
    @hemozone9726 10 หลายเดือนก่อน

    thanks man

  • @prumchhangsreng979
    @prumchhangsreng979 2 ปีที่แล้ว +3

    I'm grateful that I didn't skip binary in high school math class.

  • @113_bachtiardanuarta_b2
    @113_bachtiardanuarta_b2 ปีที่แล้ว

    Simple yet easy to understand

  • @thatonemailbox
    @thatonemailbox ปีที่แล้ว +5

    What kinds of uses do these commands have?

    • @Abon963
      @Abon963 11 หลายเดือนก่อน +5

      One use is : It can be really fast for calculations

    • @SoDamnMetal
      @SoDamnMetal 7 หลายเดือนก่อน

      @@Abon963 so, something the compiler would automatically optimize for you?

    • @Exploshi
      @Exploshi 4 หลายเดือนก่อน

      to quickly find if a number is a power of two you can do "return n>0 and n&(n-1)"

  • @_4p_
    @_4p_ 11 หลายเดือนก่อน +1

    where is ~ (complement operator)

  • @Thundergreen-lj2ot
    @Thundergreen-lj2ot 13 วันที่ผ่านมา

    Is it just me who noticed the text size change as the first change?

  • @mahmoudalfawair2967
    @mahmoudalfawair2967 2 ปีที่แล้ว +5

    giga big coc chad thx

  • @fedorvasilev5883
    @fedorvasilev5883 ปีที่แล้ว

    Why do you use %d ?

    • @atheist9672
      @atheist9672 5 หลายเดือนก่อน

      It is an format specifier it this time you know what is that....I hope you know😅😅😅😅

  • @jumbo999614
    @jumbo999614 8 หลายเดือนก่อน

    How to shift zero? Let's say x = 11110111 I want 11101111 (shift left) or 11111011 (shift right).

  • @kevingerges9539
    @kevingerges9539 4 หลายเดือนก่อน

    for xor , 1 OR 1 = 1: If both bits are 1, the result is , how come 1 and 1 is zero

    • @zakd6768
      @zakd6768 หลายเดือนก่อน

      X is for exclusive. Think of OR as being ok with AND.
      1 OR 1 = 1
      1 OR 0 = 1
      Because AT LEAST 1 is 1. So OR doesn't mind both being 1.
      1 XOR 1 = 0 Because AT MOST should be 1. Break it into human speech and it becomes easier.
      True is 1 and false is 0
      a XOR b = if exclusively one operand is true, return true. Else return false.
      AND =BOTH
      OR =AT LEAST 1
      XOR =AT MOST 1

  • @Lucky-ci1ve
    @Lucky-ci1ve 16 วันที่ผ่านมา

    yeah i completely forgot it

  • @nofap9596
    @nofap9596 ปีที่แล้ว

    Robert

  • @naveenkumar1853
    @naveenkumar1853 7 หลายเดือนก่อน

    Hello

  • @motasam8122
    @motasam8122 10 หลายเดือนก่อน

    try 100

  • @mastersrv470
    @mastersrv470 ปีที่แล้ว +1

    Thanks bro

  • @nattyzaddy6555
    @nattyzaddy6555 ปีที่แล้ว

    Thanks bro