Bitwise Operators in C (Part 3)

C Programming & Data Structures: Bitwise Operators in C (Part 3)
Topics discussed:
1. Bitwise right shift operator.
2. Example of bitwise right shift operation.
3. Right shift as division by 2 operator.
C Programming Lectures: goo.gl/7Eh2SS
Follow Neso Academy on Instagram: @nesoacademy(bit.ly/2XP63OE)
Follow me on Instagram: @jaspreetedu(bit.ly/2YX26E5)
Contribute: www.nesoacademy.org/donate
Memberships: bit.ly/2U7YSPI
Books: www.nesoacademy.org/recommende...
Website ► www.nesoacademy.org/
Forum ► forum.nesoacademy.org/
Facebook ► goo.gl/Nt0PmB
Twitter ► / nesoacademy
Music:
Axol x Alex Skrindo - You [NCS Release]
#CProgrammingByNeso #CProgramming #BitwiseOperators

Пікірлер: 61

  • @chrisbanas9118
    @chrisbanas9118 Жыл бұрын

    this dude is the one i want speaking at my funeral. he has practically raised me with all of these bitwise operator videos

  • @naranisrimani7343
    @naranisrimani73434 жыл бұрын

    U had clarified my doubt that no body else couldn't by explaining those important points thank u so much , u r really best teacher 😊😊😊😊

  • @BHARATAM-cc3iv
    @BHARATAM-cc3iv4 жыл бұрын

    the manner in which you have made the concepts clear, it is really appreciable

  • @ThePasiko
    @ThePasiko5 жыл бұрын

    right when I thought I was just stupid and could never actually understand bitwise operators (cuz my teacher is kind of not the best either) I watched your vids and life is so much easier now! :D Thank you man

  • @studyphile6328

    @studyphile6328

    5 жыл бұрын

    As they say,there is no bad student,only bad ..

  • @harshmk1052

    @harshmk1052

    4 жыл бұрын

    This comment is so much damn relatable :P :P

  • @ashwinivaidya4183

    @ashwinivaidya4183

    Жыл бұрын

    Exactly 💯... Same feeling..

  • @mrtechthisout

    @mrtechthisout

    Жыл бұрын

    turns out i'm not that dumb either

  • @triptiacademycentre6077
    @triptiacademycentre60772 жыл бұрын

    Thank you sir you can't even imagine that how much your help me by teaching this operators and now my doubts have been clarified thank you so much.

  • @Paiso_ka_gyan
    @Paiso_ka_gyan Жыл бұрын

    You are great sir, your videos are the only source of mine to clear my doubts, please make a complete playlist of python programming.

  • @shritea
    @shritea3 ай бұрын

    YOU MAKE IT LOOK SO EASYYYY MAN!! THANK YOUUU AGAIN!!

  • @SahilJSawant
    @SahilJSawant6 жыл бұрын

    Great video. Thanks a lot:)

  • @prashanthbhargav5326
    @prashanthbhargav53265 жыл бұрын

    Great video sir, so much helpful

  • @hemalakshmi9044
    @hemalakshmi90443 жыл бұрын

    Superb teaching... I learning c progaram. Form ur all videos... I can easily understand ur videos.. Tq ☺

  • @deepakbhardwaj3141
    @deepakbhardwaj31416 жыл бұрын

    Nice sir u r doing a great job......

  • @pulkit8490
    @pulkit84903 жыл бұрын

    you made concept very easy. thanks a lot sir

  • @MrSkyydude
    @MrSkyydude Жыл бұрын

    Thank you!!

  • @mynulislam8512
    @mynulislam85124 жыл бұрын

    Thanks a lot 💞💞💞💞

  • @shanjalgupta
    @shanjalgupta3 жыл бұрын

    a very nice explanation!!

  • @user-qk4tx9jc4m
    @user-qk4tx9jc4m3 жыл бұрын

    this is extremely clear...

  • @girmaymedhanie2498
    @girmaymedhanie2498 Жыл бұрын

    Thank you bro you're explain briefly .

  • @s1h2a3d4o
    @s1h2a3d4o6 жыл бұрын

    Thank you

  • @rrrttt4964
    @rrrttt49642 жыл бұрын

    Amazing Explained 😘♥️

  • @rishabhdubey311
    @rishabhdubey3113 жыл бұрын

    Thank u so much sir

  • @ashwinibukegar6244
    @ashwinibukegar62444 жыл бұрын

    Thanks

  • @ijeanpierrebp
    @ijeanpierrebp2 жыл бұрын

    great!

  • @marduktr
    @marduktr3 жыл бұрын

    If the var is (signed) int and shift it to right then it is not guarantee that the left side will be 0. It depends on your compiler. We can say it will get 0 if the var is ungined int.

  • @true4189
    @true41893 жыл бұрын

    Thank u

  • @user-bu8mg7uq3s
    @user-bu8mg7uq3s3 жыл бұрын

    thank you

  • @akshadrathod9203
    @akshadrathod9203 Жыл бұрын

    Nice

  • @sonusambharwal8828
    @sonusambharwal88284 жыл бұрын

    Best sir

  • @jaidippatra6440
    @jaidippatra64403 жыл бұрын

    In case of right shift of negative number, will it be converted to positive number because of leading zero padding ?

  • @sweethome8020
    @sweethome80203 жыл бұрын

    nice expalnation

  • @pavangm6867
    @pavangm68674 жыл бұрын

    Somethings are missing here , as you said when the integer is right shifted leading positions are filled with zeros this is only true if the operator is applied on "unsigned integer" in case of signed integers it will be different, i suggest you to cover that part as well so that it will be complete.

  • @LorenHelgeson

    @LorenHelgeson

    3 жыл бұрын

    It's an important distinction for sure, and I would like to know. I'm currently learning bitwise operations as they are used in C, and when it comes to bitwise operations on a signed integer, my teacher's answer is simply "Don't. Make sure your operands are always unsigned." But, why?

  • @marduktr

    @marduktr

    3 жыл бұрын

    @@LorenHelgeson if the var is negative, some compilers want to keep it negative and add 1 to the left side. Others do not pay attention to keeping the number negative and they are adding 0. Adding 1 is called arithmetic feeding and adding 0 is called logic feeding.

  • @mislead1070

    @mislead1070

    2 жыл бұрын

    But wait, wasn't the variable used in the video signed? Bec "%d" is used for displaying signed integers and thats what is used in the video

  • @st_prashant_jung_shumsher_rana

    @st_prashant_jung_shumsher_rana

    11 ай бұрын

    You are wrong he has used signed char in code so your statement won't make a sense

  • @sachinjain1641
    @sachinjain16413 жыл бұрын

    Can shifting can be done to negative number like -1,-2...

  • @shubhamyadav1910
    @shubhamyadav19105 жыл бұрын

    Sir is itonly for decimal no.? Or other no.system

  • @smrtfasizmu6161
    @smrtfasizmu61612 жыл бұрын

    What if you have a negative number (the first digit is 1 then), will this operand turn the number into a positive number (shifts the 1 to the right and makes the first left bit a 0)?

  • @buiciucdaniel6794
    @buiciucdaniel67945 жыл бұрын

    Hy ! I meet the syntax : j=1; What is this?

  • @meharoofryanmarakkar4515
    @meharoofryanmarakkar45152 жыл бұрын

    How you got output 1 in right shift whereas output 6 in left shift? I noticed that in left shift, you counted all the remaining zeros whereas in right shift you counted only the the number of places right shifted which is 1. Can you explain that?

  • @mohamedkhawaga8067
    @mohamedkhawaga80672 жыл бұрын

    why this is an error #include int main(){ float var = 3.0; int var2 =1; printf("%.2f",var >> var2 ); return 0; } and 3>>1 = 3/(2^1) =1.5 , so how to print 1.5

  • @leventemathe2610
    @leventemathe2610 Жыл бұрын

    One note: I don't think this note is always true: Right shifting is equivalent to division by 2 on the power of the right operand. I think it's only true if the last n (n = last operand) bits of the value is 0. In case of 10 >> 2, the result will be 2 as well, since not just the bit representing 8 (2 on 3rd) get's shifted, but the bit which holds the value of 2 (2 on 1st) is also just simply truncated.

  • @bestsaurabh
    @bestsaurabh2 жыл бұрын

    How about -ve numbers? It would be better if you would have captured that as well.

  • @vinayaksharma-ys3ip
    @vinayaksharma-ys3ip3 жыл бұрын

    🙏🙏💯

  • @pro-conductive
    @pro-conductive Жыл бұрын

    Hope you would come back (youtube)

  • @bhargavraghuram
    @bhargavraghuram2 жыл бұрын

    OP

  • @compangit1524
    @compangit1524 Жыл бұрын

    Comments for myself: leading positions will be filled by zero. Cool fact is that return value of right shift is equal to var / (2^numOfShifts).

  • @bharathgandham3410
    @bharathgandham3410Ай бұрын

    bro can u increase ur volume in next videos

  • @bhavanipatil4984
    @bhavanipatil49845 жыл бұрын

    I need answer for homework question for clarification sir

  • @scramjet4610
    @scramjet4610 Жыл бұрын

    This video is correct only for unsigned, but it is not correct for signed; specifically, Important Point 1 is not correct for signed char and signed int because for signed vars, 1 is shifted in from the left, not zero. This video is true only for unsigned. For example, using the mingw GCC C compiler: char test1, test2 test1 = 0xFF; test2 = test1 >> 1; printf("test1 = %d and test2 = %d ", test1, test2); Results in test1 = -1 and test2 = -1 which means that the the binary for test1 = test2 = 0xFF = b 1111 1111 which is 2s Complement -1, hence showing that 1 is repeated from the msb. If 0 was always shifted in from the left as the video states, the output would be test1 = -1 and test2 = 127.

  • @AbbaJi-gm4vc
    @AbbaJi-gm4vc4 жыл бұрын

    I have a doubt...At last the video u give the explanation...3/2 u get remainder as 1 and that is the answer and the second case 32/16 you got 2....And said this is the answer while remainder is 0 how it can be possible...??

  • @MatteoYTGaming

    @MatteoYTGaming

    4 жыл бұрын

    You don't take the reminder

  • @aman_gupta9855
    @aman_gupta98554 жыл бұрын

    Why u have putted non skiping of video ,it actually seems to be worst . The video is not skipping by 10 sec if i download it

  • @shashimusicclub9082
    @shashimusicclub90825 жыл бұрын

    Reality to India ki kuch aur hi hai... Kabhi time mile to Depth me Jana...

  • @AbdElrahmanAmirMohamed
    @AbdElrahmanAmirMohamed3 жыл бұрын

    how can i like twice ?? 💚💚💚💚💙💙

  • @am_editz9145
    @am_editz91453 жыл бұрын

    Save cows🙏🙏🙏

  • @uditsaxena3844
    @uditsaxena38445 жыл бұрын

    Thanks

  • @monoarofficialbd
    @monoarofficialbd2 жыл бұрын

    Nice