Increment and Decrement Operators in C (Part 2)

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

ความคิดเห็น • 1.1K

  • @anupriyarani6902
    @anupriyarani6902 3 ปีที่แล้ว +419

    I have studied C from many famous youtuber and books too but I never studied C so deeply .Most of lectures brings new concepts. Thank you neso academy team 🌺

  • @kunalnarsale6944
    @kunalnarsale6944 4 ปีที่แล้ว +169

    I have started learning c from this channel . Till now i have studied c from many platforms online as well as offline . But i think this channel provides best c programming language learning . This is the BEST c programming channel i have ever seen . Also i will recommend to my other friends . Fantastic tutor !!!
    I have one small request , could you please upload C++ programming videos ?

    • @nesoacademy
      @nesoacademy  4 ปีที่แล้ว +92

      We will start C++ soon.

    • @lokeshsenthilkumar4522
      @lokeshsenthilkumar4522 4 ปีที่แล้ว +9

      @@nesoacademy when sir..still waiting?

    • @shivasaurabh2006
      @shivasaurabh2006 4 ปีที่แล้ว +3

      @@lokeshsenthilkumar4522 ohhh dude me too!!!😂

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

      @@nesoacademy what is the answer? kindly sir pin it...

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

      @@nesoacademy sir please start as possible as early

  • @shubhamanand1347
    @shubhamanand1347 4 ปีที่แล้ว +130

    best channel regarding the clarity in sound, visual and concept.

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

      Indeed, and without any 'euhh' or 'lets see...' even when hearing some distractions...
      confident and knowing what it's about! 👍

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

      @@andrevoerman1483 ahan :)

  • @Sazzad_Sabbir
    @Sazzad_Sabbir ปีที่แล้ว +77

    For the last question:-
    1)If you set the code like this in the complier:
    #include
    int main()
    {
    int a=4, b=3;
    printf ( "%d", a++ + ++b);
    return 0;
    }
    Then the output is :- 8
    2) But , if you set the code in the compiler like this:
    #include
    int main()
    {
    int a=4, b=3;
    printf ( "%d", a+++++b);
    return 0;
    }
    Then , there will be an error!
    Thank you guys

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

      How is -8 tho? Can explain for me?Thanks

    • @Dilip077
      @Dilip077 ปีที่แล้ว +6

      It's 8

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

      @@Dilip077 he wrote :- 8

    • @manu-mp5bt
      @manu-mp5bt ปีที่แล้ว +7

      First program is correct, it will not raise any error. And the last value is 8.
      Explanation: a=4,b=3; are the values we have , a+++++b means the lexemes are |a++| |+| |++b| . So 'a' is used and incremented to 5, and b is incremented to 4 and then used in expression. So the final answer will be 8.
      Second program will generate error because immediate after an increment or decrement we should have a variable

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

      @@manu-mp5bt but the question doesn't have spaces and "error" is one of the answers so I believe 8 would only be right if spaces you showing were part of the written program. please do correct me if I'm wrong. otherwise d is the right answer for me

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

    You rock guys. Keep it up 👍 And yeah the answer to the homework question is d)error. Had it been written with a space as a+++ ++b, the answer would have been 8. But as it is, i.e., a+++++b, it is evaluated as |a| |++| |++| |+| |b| or (a++)++ + b which causes an error because an an increment operator doesn't take an rvalue or a++ as its operand. As discussed more clearly by neso, both increment and decrement operators work only on lvalue(left value).

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

      There's an error in your statement. The answer would have been 8 if written as a++ + ++b not a+++ ++b

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

      8

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

      error: lvalue required as increment operand
      You are right i have tried it

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

      @@monikak1421 he is right that will give you error .if you have watched the lecture properly then only you can get why,. It's a concept of spacing

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

      @@monikak1421 he is right, you are wrong bro

  • @venugopalreddy8596
    @venugopalreddy8596 3 ปีที่แล้ว +32

    I don't know how many times I should say thanks to this channel.
    Such a wonderful channel.
    Great channel.❤️

  • @boscodizilva5613
    @boscodizilva5613 6 ปีที่แล้ว +242

    Black theme = less strain for eyes!
    Neso uses black background!!

    • @kushalavardhan
      @kushalavardhan 4 ปีที่แล้ว +20

      why do programmers prefer Dark interface?
      ans : because light attracts bugs

    • @nfscsk
      @nfscsk 4 ปีที่แล้ว +3

      @@kushalavardhan , 😂😂 but light kills "Viruses"!!!!!....
      which means white screen (blue light) greatly affects eyes😞, but at the same time blue light(UV- ultra violet) kills "viruses"😝...

    • @nfscsk
      @nfscsk 4 ปีที่แล้ว +3

      @@kushalavardhan ,
      why do applications prefer Bright interface??
      ans: because light kills viruses
      wow!! i created one new joke😂😂💪

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

      @@nfscsk 🤓🤧🚶nice joke

  • @patoogudere4394
    @patoogudere4394 3 ปีที่แล้ว +18

    I've been in total darkness when it comes to programming, but atleast I got this firtunate opportunity to know about Neso Academy, Thank you so much Neso Academy for taking your time and provide for us these wonderful lectures, Thank you once more and be blessed

  • @accessdenied9393
    @accessdenied9393 3 ปีที่แล้ว +14

    I do not know how I can describe my humble thanks to you and my admiration for you. You literally crossed all limits in brilliance and creativity. You are still glamorous and still awesome until now and for sure all the time.

  • @NMAJJINEERAJA
    @NMAJJINEERAJA 4 ปีที่แล้ว +17

    Really awesome
    Actually I learnt c and data structures before so I thought that I can skip the videos because I I know the concept
    But I never skip any video because every video contains a new and interesting topic.
    Thank you very much sir

  • @anjaliawasthi4623
    @anjaliawasthi4623 6 ปีที่แล้ว +34

    Awesome haven't learn these operator in such a way

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

    Answer to the question is ERROR.
    As a+++++b is tokenize as - a ++ ++ + b = (a++)++ + b
    So, as increment operator can take only lvalue so, compiler generates error.

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

    This is the best youtube channel to learn C-Programming. I've never read a book or seen a video explain unary operators this way.

  • @chanduvs3037
    @chanduvs3037 3 ปีที่แล้ว +6

    One of the super duper channel which I had never seen over the years. When it comes for vocalize, we can't express it out. Finally it is a student friendly tutorial.

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

    I never knew learning programming could be so fun and deeply informative.
    You just made my life better.
    Cheers to Neso Academy.

  • @TonyStark-de3nx
    @TonyStark-de3nx 4 ปีที่แล้ว +13

    Great Teacher , fabulous teaching style... ~I am your fan sir.

  • @half_notes_9133
    @half_notes_9133 3 ปีที่แล้ว +18

    All the teachers are extremely good
    They explaine each and every word they said with easiest of ways possible.
    Best educational channel on TH-cam.

  • @VamsiKrishna-ym3cr
    @VamsiKrishna-ym3cr 4 ปีที่แล้ว +110

    Error..
    a++ means a=a+1
    a++++ means( a+1)=(a+1)+1
    But ,lvalue is required to use increment operator..

    • @swagatikasahoo1531
      @swagatikasahoo1531 3 ปีที่แล้ว +4

      Thank you for the explanation 👐

    • @pineapplee101
      @pineapplee101 3 ปีที่แล้ว +14

      Cant that be a++ + ++b ?

    • @ojaskumar2355
      @ojaskumar2355 3 ปีที่แล้ว

      @@pineapplee101 yess i thought the same process🙌

    • @VamsiKrishna-ym3cr
      @VamsiKrishna-ym3cr 3 ปีที่แล้ว +21

      @@pineapplee101 lexical analyser scans longest and valid Tokens ..there we are given a+++++b and if we generate tokens we get 'a' ,'++' ,'++', '+' , 'b'...

    • @hetaeramancer
      @hetaeramancer 3 ปีที่แล้ว +12

      @@pineapplee101 i think this can work, and it will be equal to 8
      a++ and then + and then ++b

  • @compangit1524
    @compangit1524 ปีที่แล้ว +11

    Comments for myself: lexical analyzer scans the code and tries to find meaningful sequences which it converts to tokens to translate. Usually, meeting a blankspace will stop the current token generation. Post-increment happens after the current value of the variable is used in the function.
    My answer for the assignment is d) error
    We first need to get the sequences of tokens to get an overview of what's about to happen. The sequence of tokens is [a] [++] [++] [+] [b]. This might seem to work, but if we try to go thru it one by one. a++ is fine, but a++++ is not. a++++ may seem valid but ++ operator requires to be accompanied by an lvalue. a++ is an rvalue hence, an error will be thrown at that point.

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

    I have enjoyed these lessons immensely. Your combined approach of discrete, literal and figurative explanations is more comprehensive and is more effective in building a stronger association for understanding the subject. The value of your understanding is made more accessible through clear instruction and is accomplishing its intention and multiplying into others being able to understand it as well. That's good teaching. It's a skill and a gift. Thank you. It's inspiring. I am a US Citizen, born and raised. I have benefited greatly from this resource. Thanks for your willingness and ability to share.

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

    Output = 8 a, ++, +, ++, b will be tokens generated by lexical phase
    As ++ is a unirary operator so after first ++ is generated second ++ won't find any variable near it so it backtrack to + only and then ++ will be generated next token bcz it will find b as nearest variable.

  • @prateekraghuvanshi1291
    @prateekraghuvanshi1291 6 ปีที่แล้ว +76

    a++ means a= (a+1)
    a++ ++means (a+1)=(a+1)+1 which is not allowed so it will produce error

    • @thawedmind
      @thawedmind 4 ปีที่แล้ว +15

      gotta try it to be sure, gonna do that in a min, but I think that the token analyser will token it like this [a++][+][++b].

    • @thawedmind
      @thawedmind 4 ปีที่แล้ว +6

      you were right, It sees it as a r value.

    • @sadirirfan9008
      @sadirirfan9008 4 ปีที่แล้ว +8

      @@thawedmind
      but it can analyse like this way also
      [a++][++][+][b] because [++] is a valid lexeme.

    • @YoYo-nt7yf
      @YoYo-nt7yf 4 ปีที่แล้ว +1

      No it read from the left so it will be a++ which is 5
      Then a++ (here a is 5) ie. 6
      a is 6 and b is 3
      So
      6+3 which is 9

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

      @@thawedmind u are wrong bro, compiler start reading character from left to right until it finds meaning full token.

  • @AlokSingh-jw8fr
    @AlokSingh-jw8fr 3 ปีที่แล้ว +7

    I have studied C language earlier and I started thinking that I know everything but this channel makes me realize that I know everything of what was taught not everything about c language.No other youtube channel has cleared concepts this way with so many logical examples. I feel quite fortunate that I got to know about this channel in the 2nd-semester only after ruining my basics earlier by studying from other so-called famous TH-camrs.One humble request is there any book required for C language for gate prep or your videos and previous years is enough? I'll be grateful to you if you reply.
    If you find some words in my English rude then sorry for that because I am in earning phase

  • @ravindra_sings_
    @ravindra_sings_ 3 ปีที่แล้ว +11

    In each and every video it seems that you are opening some parts of my mind, I am learning some new things in every video. Thank you very much sir for these amazing videos.

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

    Best C tutorial on TH-cam, so explanatory, all concepts are also easy to remember. Thanks so much for this, loving C more right now thanks to you

  • @Official-tk3nc
    @Official-tk3nc 5 ปีที่แล้ว +135

    Guys they are providing everything for free and some idots dislikes these types of videos. I think they need mental treatment

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

      May be they are some other c teachers... 😅😅 who dont know how to teach... And they are getting jealous of our sir.... Those who dislike these videos are really fools...

    • @thawedmind
      @thawedmind 4 ปีที่แล้ว +3

      some people don't like the accent. I'm following through the whole course and its really helpful because of the backgroudn knowledge which I just don't get anywhere else, other people are just looking for quick answers and wouldn't appreciate the diversion into tokens. Just to clarify I think this guys amazing I feel as if I'm getting a complete understanding for the subject. =D

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

      @Nadeem Afzal yes 100% correct

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

    a ++ ++ + b. Value 'a' assigns 4 in the equation first, then increments. So, 4++ +3 is the completion of equation. Since 4 is a constant and a constant can't handle increment operator, this is an error.

  • @yadvendragarg1747
    @yadvendragarg1747 4 ปีที่แล้ว +7

    Best teaching style
    Only from one lecture i understood so many concept
    Thank sir .

  • @namitasharma5201
    @namitasharma5201 4 ปีที่แล้ว +8

    no words to show gratitude. Thanks for doing the great work. Thank you so much.

  • @camerald8257
    @camerald8257 3 ปีที่แล้ว +23

    The last question is tricky, but it means I just have many things to learn. I am lucky to find this channel now as a 1st year college stud.

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

      error is the ans

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

      @@its_SR07 Isn't it 8, brother?

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

      @@hippityhoppity71 nope error will be the answer

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

      @@prabhatsingh6124 is it because the fact that u cannot increment operators am I right?

  • @dennyage4791
    @dennyage4791 3 ปีที่แล้ว +9

    In every video I am liking it first, than watching it , 😂😂
    Becoz , many people forget to like , becoz of excitement !
    Great course sir

  • @TonyStark-de3nx
    @TonyStark-de3nx 4 ปีที่แล้ว +20

    Sir, I don't know your name but the way that u taught us is awesome. I really enjoy all these and learn a lot from these series.....

    • @anupriyarani6902
      @anupriyarani6902 3 ปีที่แล้ว +4

      Follow Neso academy in instagram. You will get to know all the members of neso academy 😁

  • @FaisalAhmed-jd9rr
    @FaisalAhmed-jd9rr 2 ปีที่แล้ว +3

    You are the best teacher that I have ever got in my entire student life.

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

    Guy I never knew I could understand the topic of token generation and compiler design and how it interprets. I am really grateful to be in this century where everything is in the internet. Thank you

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

    With this lectures I'm one step ahead of the teacher, well explained

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

    Input: a+++++b
    Output: Lvalue error

  • @selvalakshmis.v4232
    @selvalakshmis.v4232 3 ปีที่แล้ว +11

    d)Error
    Reson: lvalue required as increment operand
    Thank you, Sir

  • @pardhasaradhi4291
    @pardhasaradhi4291 3 ปีที่แล้ว +4

    I have a doubt on it for long time since then I frequently searching to solve my doubt but no one clarify in depth you clarified it. Thank you bro👑

  • @TonyStark-de3nx
    @TonyStark-de3nx 4 ปีที่แล้ว +4

    Sir u are my favorite teacher in all TH-cam teacher even you are from one of the best teachers of my life.... Thank you so much sir

  • @sandhyachowdhary2511
    @sandhyachowdhary2511 4 ปีที่แล้ว +7

    Your teaching is extremely good . Very deep explanation on concept I have got deep understanding on each and every concept. Thank you very much sir. Wish you were my teacher in college wouldn't have hated coding.🙏

  • @0x656e
    @0x656e 4 ปีที่แล้ว +12

    Such an awesome contents you provding here sir. Thank you. May you live long, healthy and happy❤

  • @ernestekomwa-b5h
    @ernestekomwa-b5h หลายเดือนก่อน +1

    Thank you Neso academy for taking your time to deliver this wonderful lectures to us

  • @hymasubramanyan
    @hymasubramanyan 6 ปีที่แล้ว +33

    answer is 8 ,when we put proper spacing between the operators, ie,
    a++ + ++b;

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

      But there is no proper spacing here

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

      Why not 9.
      If
      a++ is 5
      Then +
      ++b is 4
      5+4=9
      I don't understand

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

      @@manalkhazraj It is just error.

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

      @@manalkhazraj a++ is post increment operator,hence increment will be after the evaluation.

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

      No you are wrong answer is error

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

    error: lvalue required as increment operand
    printf("The value of %d+++++%d %d is:",a,b,a+++++b);

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

    Answer of the last question is 8
    Because (a++) + (++b)
    =4 + 4
    = 8
    And a contains 5 and b contains 4

  • @purushothamchembeti8606
    @purushothamchembeti8606 6 ปีที่แล้ว +35

    ans:error because a+++++b can be generated as token as |a| |++| |++| |+| |b| now as it is the post increment first the equation will be evaluated then operand will be incremented, so a+b=7, and a=4 , two ++, ++ operators will be there, as increment acts on single operand another ++ can't be evaluated.so it gives error.

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

    I have never study any Programming Language so deeply . There are lot of things available in the market but none can Provide such content .

  • @vikassaini1935
    @vikassaini1935 4 ปีที่แล้ว +6

    FAR Better than my college professors

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

    Legend bro you are! I am doing my BSC in computer science .until to complete my bsc i will stay with your cannel. From Bangladesh.

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

    first of all you ar really great teacher ,I like the method you use to explain .regardless of it is my first time keeping following a lecturers online put I truly got a huge benefit out of your lecturers ,the answer is 8 because after token generation |a| |++| |+|
    |++| |b| so post increment we will use the value first the increment but in pre increment we must first increment the value .It goes like this a=4 b=3 so 4+4=8

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

      Those are not the longest sequences of meaningful characters. What about |a| |++| |++| |+| |b| ? These are the longest sequences of meaningful characters, so we get an error "lvalue required as increment operand", because a++ ie a = a + 1 is not lvalue.

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

    the answer is 8. because if we proper tokens between them like |a++| |+| |++b|. In que a=4 and b=3, |a++|=4 and |++b|=4 depending upon the given terms explaing in vedio on pre and post increment. so the answer is 4+4=8.

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

    a++ ++ + b as a++ is replaced with 4 but for ++ no operand availabe it produce error

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

    #include
    int main()
    {
    int a=4, b=3;
    printf("%d", a+++++b);
    return 0;
    }
    output : 8
    solving: a++ + ++b
    hear a++ is post, or ++b is per and + is use of addition

  • @tharunkumarcheripally9712
    @tharunkumarcheripally9712 4 ปีที่แล้ว +7

    By Lexical analysis , which provides meaningful expressions
    expression : a++ + ++b = 4 + 4 = 8

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

    The tiniest bit of detail provided by Neso Academy is commendable. Many paid courses are not at par with the level of content provided by Them.

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

    Q3> It will show Error , if we put space before and after of middle + then answer will be 2)8.

    • @UNKNOWN-tq4lq
      @UNKNOWN-tq4lq ปีที่แล้ว

      the main data entry is planked so it will be only 8 when the data type been planked.
      this will be the correct explanation for this answer

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

    the best channel for code learning

  • @pritamkrdas8696
    @pritamkrdas8696 4 ปีที่แล้ว +6

    It will show an error ,, but if we. Put the line. Like
    a++ + ++b then it will give the output 8 .. so after putting space at a &b we will get the output

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

    Lexmer will convert it to -> |a| |++| |++| |+| |b|
    and it will consider the two double pluses, a++ ++, undefined then it will produce an error!

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

    Output :
    error: lvalue required as increment operand

  • @estellaricaluna7927
    @estellaricaluna7927 4 ปีที่แล้ว +3

    The best channel

  • @Tussu17
    @Tussu17 6 ปีที่แล้ว +12

    Awesome tutorial

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

    I thanks a lot Anikalp ❤️ for recommending me this channel.

  • @jeevajeevan1346
    @jeevajeevan1346 4 ปีที่แล้ว +7

    error: lvalue required as increment operand

  • @Kevin-yl4hm
    @Kevin-yl4hm ปีที่แล้ว

    You are the best teacher I have found for c programming.

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

    Answer for the given homework problem is 8
    and thank you very much sir for helping lot of students to study through this course

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

    Best channel I study a lot of channels but this one is best 🤗🤗thanks sir

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

    [a] [++] [++] [+] [b] is error as no operand for 2nd [++]
    so is it possible for lexems to be like this?
    [a] [++] [+] [++] [b]
    because it has a option to either read it like [+] or [++]

    • @poornachandra3138
      @poornachandra3138 3 ปีที่แล้ว

      Hello

    • @shreyaskulkarni526
      @shreyaskulkarni526 3 ปีที่แล้ว

      2:43 it always matches the longest character sequence, so their is no option read it like + or ++,
      it will read it as ++ and not +

    • @rohannayak3827
      @rohannayak3827 3 ปีที่แล้ว

      SO ANSWER IS SAME 7/ERROR

    • @anuj_chaudhary_2430
      @anuj_chaudhary_2430 3 ปีที่แล้ว

      @@rohannayak3827 nups may be its 8/ error...still confused

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

      It's the first way and the answer is error

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

    After studies c programme in many channel i found this channel and i think I feel better after study in this channel thank you so much sir🥰🥰🥰🥰

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

    Great conceptual video

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

    Congratulations for 1M🎉🎉

  • @rangrezuzma9853
    @rangrezuzma9853 4 ปีที่แล้ว +3

    You have a great knowledge sir

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

    Even ,nit Suratkal students almost every one watch this series of c programming tutorial,,... really good

  • @abhisekrout976
    @abhisekrout976 4 ปีที่แล้ว +8

    Option (a) 7
    Token will be generated as: [a] [++] [++] [+] [b]
    Which can be reduced as: a++ ++ + b {first assignment of variable then increment}
    4 ++ + 3
    [4++] + 3 {first assigment then increment
    4 + 3
    7
    As there is use of post increment operators in all the stages hence the value of 4 is retained till the end.
    Please comment if I'm wrong.

    • @farzanhayat3288
      @farzanhayat3288 4 ปีที่แล้ว +7

      You're totally wrong brother..there is no space provided in the code so token will be generated but the second increment operator will need a Lvalue..hence giving an error :)

    • @abhisekrout976
      @abhisekrout976 4 ปีที่แล้ว +3

      @@farzanhayat3288 yup got it. Missed regarding Lvalue. Thanks

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

      Good morning guys

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

      [a][++][+][++][b]
      [a++][+][++b]
      4+4=8

  • @ramesh.pikkili6886
    @ramesh.pikkili6886 3 ปีที่แล้ว +1

    Great teacher who explaining crystal clear

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

    This channel taught me the topics that I learnt from college and then ignored it thinking irrelevant.

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

    Life saviour channel❤

  • @ahmedelhddad9744
    @ahmedelhddad9744 4 ปีที่แล้ว +3

    Best channel Ever!!

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

    thank you sir, im from africa

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

    Is the correct answer for Q 3 option (b) 8?

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

      No , error will arise

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

      @@koinahotahai why

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

      @@koinahotahai it will be seperated in tokens as a++ + ++b

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

      @@tomidebbie2078 error arises

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

      @@tomidebbie2078 a | ++ | ++ | + | b = ((a++)++ error at this step since a++ is a rvalue)+b

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

    Nice method of teaching...Superb....I love it

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

    Answer is d...it gives an error name Lvalue required .......but when I write the code (a++ + ++b)there is no error

    • @matlapudipavaneswarsatyaap2667
      @matlapudipavaneswarsatyaap2667 4 ปีที่แล้ว +4

      answer is b

    • @matlapudipavaneswarsatyaap2667
      @matlapudipavaneswarsatyaap2667 4 ปีที่แล้ว +4

      sorry guys answer is d it divides the lexemes into a ++ ++ + b .and groups into a++ ++ +b .here lvalue is not there to store the value it gives error. So, answer is d.

    • @004_it_ajay_veerabaghut5
      @004_it_ajay_veerabaghut5 4 ปีที่แล้ว

      @@matlapudipavaneswarsatyaap2667 Yeah I thought the is B .because lvalue divide like this a++ /+ /++b 🤔

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

      They have no spaces. Between them so lexical will find the second (++) right after the first (++) ends.

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

      @@pradoshkumarrout519 no bro

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

    Best teacher .....💙💙
    Before I came to know about u I really face difficulty with all this stuff ....
    Such an amazing teacher...

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

    Last question answer is Error

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

    Sir , I have no words to thank you. ❤️Next level content.😊

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

    Sir, you are great 😍.....i really understand the concepts deeply taught by you 😁. The answer will be for the last quest .|a| |++| |++| |+| |b|
    This will give error because it is unvalid expression 😁

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

    Error is the last question's answer.thank you neso academy

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

    #include
    int main() {
    int a=4,b=3;
    printf("%d", a+++++b);
    return 0;
    }

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

    the last question answer is an error
    because in token generation we get
    |a| |++| |++| |+| |b|
    in this case we are getting
    a++ ++ = (a+1)++
    here (a+1) is a rvalue which is not allowed for increment so we will get an error.

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

      You're the only one I saw who got the answer and explained it correctly.

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

    the answer is option d because a+++++b [Error] lvalue required as increment operand

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

    a++=(4 in expression)and(5 in increment) and again increment so ( a=5in expression) and(5+3)=8

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

    Q3) L value required error
    Evaluation (a++)++ + b
    Once a++ is evaluated then it becomes 4++, since 4 is not a modifiable l value, compiler will throw and l value required error

  • @nirmalamanthngauda1517
    @nirmalamanthngauda1517 6 ปีที่แล้ว +3

    Great Teacher!

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

    it will produce error! thanks for this course, you're really great..

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

    The answer was 8 for homework question sir

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

    The answer is definitely d. Thank you so much for the great explanations

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

    It runs the program when we use spaces i.e a++ + ++b and outputs 8 ... Otherwise gives errors.

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

      Right bro

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

      @Poonam Rathore in my opinion it is the compiler error
      Bcoz when we are adding a+++b compiler simply generating token in that way a++ + b (I don't know how to put the value under the box in typing so I used space for clarification )
      So, in given question we can think that the compiler should generate tokens in that way
      a++ ++ + b
      But what compiler do a++ but it is unable to add another post increment in it that's why it is showing error
      I think this might be helpful to you
      I am not 100% sure if someone clarify more betterly then leave a comment

    • @RAVITEJAP-ss9rl
      @RAVITEJAP-ss9rl 3 ปีที่แล้ว +1

      @Poonam Rathore a+++++b in token is a ++ ++ + b. So it is same as writing [(a+1)++]+b..... And for the post increment operator lvalue is required but here a+1 is not a lvalue. So we get an error.

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

    Very good and clear lecture on c programming i love this teachers learning techniques,i am a bca student 2024❤

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

    ERROR: lvalue required as increment operand

  • @CarlJohnson-jj9ic
    @CarlJohnson-jj9ic ปีที่แล้ว

    (a++) + (++b) => a + (b = b + 1, b) , a = a + 1 => a + (b = b + 1), a = a + 1 or something...but deepends on how the increment is implemented, as an r-val from an assignment expression or a CSV r-val from an assignment, object expression for which the latter would actually support them as l-vals then and cast to void if desired...