C bitwise operators 🔣

  Рет қаралды 102,630

Bro Code

Bro Code

Күн бұрын

Пікірлер: 82
@BroCodez
@BroCodez 3 жыл бұрын
#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 Жыл бұрын
What software do you use?
@Abon963
@Abon963 Жыл бұрын
​@@namansalgotra6293If you are talking about where he writes the code it’s "Vs code"
@md.lutfullahillabib
@md.lutfullahillabib 5 ай бұрын
where is you "Bitwise Complement Operator (~ tilde) in c" tutorial? @BroCodez
@sevanthishekar4379
@sevanthishekar4379 8 ай бұрын
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 6 ай бұрын
thats cool thx man
@rickgrimes47
@rickgrimes47 2 ай бұрын
Similarly Right Shift, x>>n = x/2^n, where 2^n is 2 raise to the power n.
@tomsterbg8130
@tomsterbg8130 Жыл бұрын
This was very easy to understand and while being really descriptive, thank you so much for making that video!
@guillaumelacroix8730
@guillaumelacroix8730 Жыл бұрын
you are a legend mate! Thank you for this clear explanation!
@keynadaby
@keynadaby Ай бұрын
I finally understood it!! I was so confused with CS50 week 4 PSET recover, now I got it, thanks!
@xbaleks4609
@xbaleks4609 Жыл бұрын
better than a course that i bought (74.99$) on udemy... Thank you, very clear and understandable.
@MerrowGula
@MerrowGula 6 ай бұрын
you know that the udemy courses have discounts right ?
@guilhermecampos8313
@guilhermecampos8313 5 ай бұрын
Warning: just buy udemy courses when they are on sale. It happens very often (something like every other week).
@arnavtripathiyo
@arnavtripathiyo 9 ай бұрын
Thank you so much very easy to understand because of your video
@antoinebguitar2869
@antoinebguitar2869 9 ай бұрын
Oh so those scary looking math equations are actually just logic gates and boolean algebra lol
@pemudahijrah2454
@pemudahijrah2454 Жыл бұрын
So bassically 12&6 is equal to 6&12 is it?
@Vishnu-wz5ng
@Vishnu-wz5ng 11 ай бұрын
Yes
@Smexyman0808
@Smexyman0808 2 ай бұрын
It's a logic operator; There is no left and right.
@saiganeshj10
@saiganeshj10 Ай бұрын
wonderfully explained. awesome. You are the real G.
@Garrison86
@Garrison86 2 жыл бұрын
Awesome thanks for the demo on bit wise operators, super easy to understand 👍👍👍👍
@ar_felix
@ar_felix 2 ай бұрын
what is complex about the complement operator? it seems it just inverts 0 to 1 and 1 to 0
@imperialenforcer2271
@imperialenforcer2271 27 күн бұрын
As someone who is in VLSI design, we do this all the time in Verilog.
@ronalbocher4159
@ronalbocher4159 11 ай бұрын
Thank you so much! Extremely clear, amazing explanations!
@marcusviniciusalves4199
@marcusviniciusalves4199 Ай бұрын
this is just perfect, thanks for the explanation
@prumchhangsreng979
@prumchhangsreng979 2 жыл бұрын
I'm grateful that I didn't skip binary in high school math class.
@LBCreateSpace
@LBCreateSpace 3 ай бұрын
Amazing explanation. Thank you
@mariaangeldas1554
@mariaangeldas1554 Ай бұрын
Thank you Bro Code. U saved me for my quiz
@natesr5373
@natesr5373 4 ай бұрын
Get truncated is the word I'm looking for. Thanks Bro Code. nice video
@thatonemailbox
@thatonemailbox Жыл бұрын
What kinds of uses do these commands have?
@Abon963
@Abon963 Жыл бұрын
One use is : It can be really fast for calculations
@SoDamnMetal
@SoDamnMetal Жыл бұрын
@@Abon963 so, something the compiler would automatically optimize for you?
@Exploshi
@Exploshi 10 ай бұрын
to quickly find if a number is a power of two you can do "return n>0 and n&(n-1)"
@P_Ahmed_P
@P_Ahmed_P 2 ай бұрын
When you promote a friend to admin in a Facebook group, you can assign them certain permissions, which control what they can do in the group. These permissions are typically represented as a series of options, each with a corresponding value, like this: Option 1: Approve posts (value: 1) Option 2: Delete posts (value: 2) Option 3: Pin posts (value: 4) Option 4: Manage members (value: 8) Permissions can be combined using a binary system. For example, if you give your friend a permission value of 5, you’re essentially giving them a combination of options 1 and 4. In binary, 5 is represented as 00000101, where the 1s correspond to the permissions you've enabled. To check if a certain permission is included, you can use the bitwise AND (&) operator. If you want to check whether they have permission for a specific option, you can perform the AND operation between the permission value and the option's value. For example, checking if option 1 (value 1) is enabled for a permission value of 5 would look like this: 5 & 1 = 1 (True, they have permission) 5 & 2 = 0 (False, they don’t have permission) 5 & 4 = 4 (True, they have permission) This way, you can easily determine which specific permissions are granted using a single number.
@Mathieuny
@Mathieuny 6 ай бұрын
Thanks for the video. Very understandable, good to get me started :)
@SuperIL12
@SuperIL12 7 ай бұрын
Excellent! Perfect explanation!
@Abon963
@Abon963 Жыл бұрын
Thanks!You made it very much easier
@CoffeeDump
@CoffeeDump 6 ай бұрын
i finally know what this operators means, thanks.
@Raphamerlo
@Raphamerlo 4 ай бұрын
Thank you. I perfectly understood.
@sais640
@sais640 Жыл бұрын
thanks bro code for the helpful tips :) and to everyone have fun programming
@jacksoncobb2860
@jacksoncobb2860 Жыл бұрын
Super helpful video! Thank you!
@nataaalia
@nataaalia 11 ай бұрын
Such a good explanation
@MonirsOfficial
@MonirsOfficial 11 ай бұрын
Masterpiece❤
@usurpvision
@usurpvision 10 ай бұрын
Ok cool thanks my reference book did not explain shifts very well.
@cd-stephen
@cd-stephen 2 жыл бұрын
Bro!!!!! You are awesome and thank you
@Jaimin_Bariya
@Jaimin_Bariya 3 ай бұрын
Jp Here, Thank you :)
@BARATHBSIT
@BARATHBSIT 3 жыл бұрын
Your a real programmer 😎
@ansoncheng6418
@ansoncheng6418 6 ай бұрын
Thank you for this
@ironmonkey1990
@ironmonkey1990 5 ай бұрын
Thank you!
@SaiTaX_the_Chile_boi
@SaiTaX_the_Chile_boi 2 ай бұрын
bro code the goat.
@_4p_
@_4p_ Жыл бұрын
where is ~ (complement operator)
@mortenlund1418
@mortenlund1418 Жыл бұрын
thx and great style
@rydinorwin
@rydinorwin Ай бұрын
Perfect!
@abdoumourouj6551
@abdoumourouj6551 4 ай бұрын
huge respect
@hemozone9726
@hemozone9726 Жыл бұрын
thanks man
@YohayShabtiev
@YohayShabtiev Жыл бұрын
BIG LIKE!
@indigo_diary
@indigo_diary Жыл бұрын
Thank you so much :)
@dredogu06
@dredogu06 2 жыл бұрын
Thanks bro
@itsrmbaby
@itsrmbaby 10 ай бұрын
شكرا
@Dexterdevloper
@Dexterdevloper 9 ай бұрын
Thanks.
@113_bachtiardanuarta_b2
@113_bachtiardanuarta_b2 Жыл бұрын
Simple yet easy to understand
@aymanmouhcine5749
@aymanmouhcine5749 Жыл бұрын
Thank you
@lizisichinava6733
@lizisichinava6733 3 ай бұрын
TYSM
@Darkin-w
@Darkin-w 11 ай бұрын
Ty :)
@Thundergreen-lj2ot
@Thundergreen-lj2ot 6 ай бұрын
Is it just me who noticed the text size change as the first change?
@bowa
@bowa 11 ай бұрын
King!
@MiyamotoMusashi23839
@MiyamotoMusashi23839 4 ай бұрын
thx buddy
@Aufrichtig-und-wichtig
@Aufrichtig-und-wichtig Ай бұрын
legend.
@fedorvasilev5883
@fedorvasilev5883 Жыл бұрын
Why do you use %d ?
@atheist9672
@atheist9672 11 ай бұрын
It is an format specifier it this time you know what is that....I hope you know😅😅😅😅
@trantung8474
@trantung8474 Ай бұрын
1:25
@kevingerges9539
@kevingerges9539 10 ай бұрын
for xor , 1 OR 1 = 1: If both bits are 1, the result is , how come 1 and 1 is zero
@zakd6768
@zakd6768 6 ай бұрын
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_Wings
@Lucky_Wings 6 ай бұрын
yeah i completely forgot it
@mahmoudalfawair2967
@mahmoudalfawair2967 2 жыл бұрын
giga big coc chad thx
@MultiDringus
@MultiDringus Жыл бұрын
bruh
@naveenkumar1853
@naveenkumar1853 Жыл бұрын
Hello
@Jesusiskingbroo
@Jesusiskingbroo 2 жыл бұрын
Robert
@motasam8122
@motasam8122 Жыл бұрын
try 100
@mastersrv470
@mastersrv470 2 жыл бұрын
Thanks bro
@nattyzaddy6555
@nattyzaddy6555 Жыл бұрын
Thanks bro
Learn C memory addresses in 7 minutes 📬
7:01
Bro Code
Рет қаралды 73 М.
Bitwise Operators and WHY we use them
8:41
Alex Hyett
Рет қаралды 95 М.
why do header files even exist?
10:53
Low Level
Рет қаралды 442 М.
The Dome Paradox: A Loophole in Newton's Laws
22:59
Up and Atom
Рет қаралды 365 М.
Intro to Binary and Bitwise Operators in C++
21:40
The Cherno
Рет қаралды 139 М.
Algorithms: Bit Manipulation
9:06
HackerRank
Рет қаралды 541 М.
C pointers explained👉
8:04
Bro Code
Рет қаралды 210 М.
Bitwise Operators | C Programming Tutorial
12:19
Portfolio Courses
Рет қаралды 26 М.
you will never ask about pointers again after watching this video
8:03
JavaScript Bitwise Operators
9:26
Programming with Mosh
Рет қаралды 103 М.
Bit Fields in C. What are they, and how do I use them?
13:26
Jacob Sorber
Рет қаралды 85 М.