Precedence and Associativity of Operators

Поділитися
Вставка
  • Опубліковано 7 лис 2024

КОМЕНТАРІ • 447

  • @purushothamchembeti8606
    @purushothamchembeti8606 6 років тому +509

    ans: True
    if(ac) given
    now have same precedence and their associativity is from left to right. initially ac also gives so now 1==1 which is true. == has low precedence compared to relational operators like >,>=,

    • @awsomeindia1295
      @awsomeindia1295 5 років тому +17

      How does ac also....plz reply I really need to know!!!!!!!!!!!!

    • @vishaliravichandran1314
      @vishaliravichandran1314 5 років тому +56

      @@awsomeindia1295 a

    • @awsomeindia1295
      @awsomeindia1295 5 років тому +16

      @@vishaliravichandran1314 thank u so much for explaining this😄😄

    • @rudraenterprises9005
      @rudraenterprises9005 4 роки тому +5

      ​@@awsomeindia1295 sun if some thing is true it return 1

    • @adhitya946
      @adhitya946 4 роки тому +6

      In if condition it is true == true right??

  • @Fun_Jet
    @Fun_Jet 4 роки тому +210

    Sir i am a cse student.... C is the 1st language for a cse student... I never forget you in my life

  • @rahilumar3002
    @rahilumar3002 6 років тому +271

    Serving people is serving humanity....nice job luv it

  • @sdk28
    @sdk28 3 роки тому +126

    Relational > Equality operator:
    -> a c
    -> (a c)
    -> ((a c) (Associativity left-right)
    -> ((10 30)
    -> ((1)) == (1)
    -> 1 (true)
    True block will execute and TRUE will be printed

  • @Mytechielife
    @Mytechielife 6 років тому +48

    As relational operator has higher precedence a c turns to 1. Therefore 1==1. Hence true will be printed because if block will get executed.

  • @Prakhar_Choubey
    @Prakhar_Choubey 4 роки тому +87

    This guy is going straight to haven 🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥

  • @nagashayanreddy7237
    @nagashayanreddy7237 4 роки тому +43

    Answer is True. Seeing all the videos from East Africa , planning to appear for GATE in 2021. I am getting confidence by listening to your lectures. Thank you for your extraordinary work. :)

  • @sidans4325
    @sidans4325 Рік тому +5

    It is the best channel to learn programming , i have watched many other channels , but i was not satisfied , but today I saw this channel and watched few videos and i am satisfied, now I have started to understand everything, thanks a lot

  • @ChintanDhokai
    @ChintanDhokai 5 років тому +21

    a).True
    if(ac) given
    Now have the same precedence and their associativity is from left to right. Initially, ac also gives so now 1==1 which is true. == has low precedence compared to logical operators like >,>=,

  • @renukadeviamalapurapu5662
    @renukadeviamalapurapu5662 2 місяці тому +1

    Sir, I am an avg student of cse 😢. I watched ur videos one day before exam the difference between ur channel and other channels is this channel provides deep concept , examples and questions for students. Thank you soo much sir.

  • @suryas1616
    @suryas1616 2 роки тому

    (ac) presedence:2
    == Presidence:3
    Answer: true

  • @adi54113
    @adi54113 6 років тому +21

    Assignment answer is: true(as 1030 is also true and both cases are compared with equality operator so it is true.)

  • @rikkalarakeshreddy6466
    @rikkalarakeshreddy6466 4 роки тому +6

    very nice channel for learning each concept and logics in C programming.
    #include
    #define x printf("THANK U SO MUCH NESO ACADEMY")
    int main()
    {
    x;
    return 0;
    }

  • @rohitrout6450
    @rohitrout6450 4 роки тому +35

    Luv it..❤your content are really very easy to understand and that question u provide at the end...is a bliss..💓💓keep working like that

  • @hemalakshmi9044
    @hemalakshmi9044 3 роки тому +7

    a=10 , b=20 , c=30 , d=40 ;
    ( a c)
    Explanation :
    (10 30)
    Here first ...10

    • @maheshtech3241
      @maheshtech3241 2 роки тому

      Thanks for answering...it helped me to understand ❤️🤝

  • @rubitadas9382
    @rubitadas9382 4 роки тому +6

    you are great sir (: the way you are clear all concepts is awesome please upload more computer science subjects so that we people will helpful.

  • @nforme7826
    @nforme7826 4 роки тому +3

    a30] which is true
    ac
    True==true
    So, output is true😊

  • @varunsamrutwar1966
    @varunsamrutwar1966 3 роки тому +1

    the ans is true ,
    explanation :-
    if(ac)
    {
    cout

  • @namita6577
    @namita6577 5 років тому

    Ans will be true because having same precedence but due to left to right associativity . Here, ac also results 1 and then == will execute which prints true.

  • @sulthanamalick9308
    @sulthanamalick9308 5 років тому +7

    Sir please compelete the C programming series it will be useful for our placements....please sir. Your video are really good.Thank you so much sir..

  • @AshishKumar-uw9xp
    @AshishKumar-uw9xp 2 роки тому +1

    Hello sir , I don't know u ll see my comment or not but u r god for the students who have eager to learn c language .

  • @compangit1524
    @compangit1524 Рік тому +3

    Comments for myself: Associativity is order of evaluation when expressions have the same precedence, could be left-to-right or vice versa. Postfix increment/decrement has greater precendence than prefix. Associativity of postfix operator is from left to right, while prefix is from right to left. Only the assignment, conditional, and unary operators have an associativity of right to left. Associativity only works of we have more than ONE operators of same precedence. If only one, the behavior is undefined and output is compiler dependent. For the assignment, the output is TRUE

  • @mohamedkhawaga8067
    @mohamedkhawaga8067 2 роки тому

    as per ac
    a belongs to
    so precednce applies
    (ac)
    in this case we have only one operator == so there is no need to apply associativity

  • @krutarthpatel6537
    @krutarthpatel6537 3 роки тому +8

    Neso is best 👍

  • @APstudent-y6s
    @APstudent-y6s 9 місяців тому

    16:10 and the answer comes out to be True
    thanks Neso❤

  • @vallipravallikaalluri
    @vallipravallikaalluri 6 років тому +4

    Tq so much i gone theough many websites but this is the 1 which fastly understand and went into my mind 😊😊

  • @samamostafa2299
    @samamostafa2299 3 роки тому

    1. we have a condition expression --> (a c)
    2. Relational precedence is higher than equality precedence therefore,
    . 'b' belong to '' operator ---> (d > c), which return TRUE
    . according to Associativity order Left to Right: (a C)
    3. finally Equality will be evaluated (1 == 1), therefore the if construct will return TRUE

  • @accessdenied9393
    @accessdenied9393 3 роки тому

    int main(void) {
    int a=10, b=20, c=30, d=40;
    int expr = (a c);
    printf("%s", expr ? "true" : "false");
    return 0;
    }
    In this example "true" get printed out. Because, "" operators take precedence over "==" operator, so both "" evaluated first then "==" operator:
    (10 30)
    Both (10 30) return true, which it is represented by 1 (or any non-zero), so the expression expanded like that:
    (1 == 1)
    Now because of (1 == 1) returns true (non-zero), "true" get printed, otherwise "false" keyword would have been printed.

  • @sahasrababy_
    @sahasrababy_ 4 роки тому

    Answer is True.
    Because ,d>c is true that is 1
    and a

  • @zeezoscode6954
    @zeezoscode6954 9 місяців тому

    The answer for the question is True. Thanks for the great explanation 😍😍

  • @sushmanthavala7813
    @sushmanthavala7813 3 роки тому +1

    You are the god for many students sir love you ❤️

  • @udittiwari8409
    @udittiwari8409 4 роки тому +1

    this your video is best and is this is fully complete series for gate sir plz tell i am following your series

  • @Fun_Jet
    @Fun_Jet 4 роки тому +8

    You are the real hero sir........ 🙏🙏🙏🙏🙏

  • @Atharhashmisir
    @Atharhashmisir 5 років тому +1

    Thankyou very much. I have started C programming lectures in Hindi. you are helping me a lot.

  • @lets___explore
    @lets___explore 5 років тому +2

    Ans is true....i understand the concept very well☺..thakiieeww soo mch...

  • @brotherinterest6912
    @brotherinterest6912 2 роки тому +2

    so what happen in the last question is that (ac). so there are 2 relational operator and 1 equality operator or u can say (a relational operator b equality operator d relational operator c). so relationall operator has higher precedence and it goes from left to right then (1030), 1030 that s also true (1) then 1==1 true == true that s also true, so TRUE

  • @7Strigiformes
    @7Strigiformes 5 років тому +6

    Thanks a lot sir for these types of great videos...

  • @bhargavchowdary45
    @bhargavchowdary45 3 роки тому

    ans=true;
    #include
    int main()
    {
    int a=10,b=20,c=30,d=40;
    if (a c)
    {
    printf("true");
    }
    else
    {
    printf("false");
    }
    return 0;
    }

  • @Xardas_
    @Xardas_ 2 роки тому

    Since the

  • @realgamerz5575
    @realgamerz5575 2 роки тому

    home works answer is true
    thank u so much to give such a great content free of cost

  • @sukhbeersingh5811
    @sukhbeersingh5811 3 роки тому +1

    The output of the homework problem is TRUE.👍

  • @saraiahd
    @saraiahd 11 місяців тому

    if(ac) in this expression left to right associativity is there
    a30
    now 1==40 returns false means 0
    now 0>30 returns true means 1
    if(1) means true so TRUE will be the answer

  • @ka7126
    @ka7126 3 роки тому +2

    Thank you so much, bro, you explain this so well; I'm set for success in my class moving forward

  • @natnaellegesse1881
    @natnaellegesse1881 3 роки тому +1

    (2+3)*5 =25 it is correct and it is called distributive property of multiplication over addition, 5*2+5*3=25
    ✔️

  • @AbdElrahmanAmirMohamed
    @AbdElrahmanAmirMohamed 3 роки тому +2

    i can't know how can i thank you
    great content ..... thank you very much 💙💙💙💙💙💙

  • @hanivarsitha2505
    @hanivarsitha2505 3 роки тому +2

    Superb explanation 👍

  • @382_alamin8
    @382_alamin8 2 роки тому

    So much attractive content thanks for it. Ans. True

  • @andlurimunireddy4622
    @andlurimunireddy4622 4 роки тому

    Ans is true.because in relational operators priority is ,=,==,=! . so according to this priority ans is considered as true

  • @crypto_key_unlocked
    @crypto_key_unlocked 3 роки тому +1

    Thanks!

  • @ashishkhari5565
    @ashishkhari5565 Рік тому

    True is the answer of the homework problem................

  • @swathik3491
    @swathik3491 5 років тому

    ac gives true and true = = true so its print True

  • @Foodfind217
    @Foodfind217 Рік тому

    Answer of the question of this lession:
    True

  • @smrutiranjanmohanty21
    @smrutiranjanmohanty21 5 років тому +2

    Excellent

  • @kishanchaurasia2909
    @kishanchaurasia2909 4 роки тому +2

    Sir I have a doubt.
    Could you explain the reason for such behaviour.
    #include
    int main()
    {
    int a=10;
    int b= ++a + a++;
    printf("%d
    ",b);
    return 0;
    }
    Output : 23
    But expected answer is 22 because first postfix will be evaluated then prefix and sum and at last assignment
    b= 12+10
    Sir please explain this.

  • @criminalcoder6307
    @criminalcoder6307 3 роки тому

    True..
    As relational operators have higher precedence than equality operator.

  • @deepeshsunuwar1086
    @deepeshsunuwar1086 4 роки тому

    the answer is TRUE.
    BECAUSE the relational operators has more precedence than equality operators,
    so (ac), here same precedence so associativity is from left to right,
    hence both returns true which means 1==1 and it is also true so the final O/P is;
    T R U E.....................................

  • @maneeshachandel8493
    @maneeshachandel8493 4 роки тому +1

    Thank you so much sir...you defined it with..minute details

  • @princeyaduvanshi9519
    @princeyaduvanshi9519 2 роки тому +2

    Very well understood everything. Thanks you sir 🤗🤗

  • @mahalingpreethi1021
    @mahalingpreethi1021 3 роки тому

    Ans:True
    ac is true which results 1;
    but 1==1 is True;
    so ans is True

  • @nishithbaravkar7549
    @nishithbaravkar7549 3 роки тому +1

    thanks for this wonderful video

  • @nandinichaudhari4513
    @nandinichaudhari4513 2 роки тому

    Very nice explanation, my all doubts get clear.

  • @sanketkumar29
    @sanketkumar29 6 років тому +4

    Sir plz make videos on cmos basics and its gate implementation.🙏🙏
    Your videos are helping me alot thank you so much🙏🙏😊

  • @selvalakshmis.v4232
    @selvalakshmis.v4232 3 роки тому +1

    True
    Thank you, Sir

  • @andistheinforitbutso7513
    @andistheinforitbutso7513 2 роки тому

    Tussi great ho Sir ji

  • @shubhammahajan6696
    @shubhammahajan6696 6 років тому +6

    one video in 2 day means syllabus finish before gate 2019 we can expect with you thanks

  • @awsomeindia1295
    @awsomeindia1295 5 років тому +2

    Thank you so so so so so much sir....really helpful and detailed video

  • @AbstractZeroData
    @AbstractZeroData 8 місяців тому

    if we consider () paranthesis as an operator then there is more than one operator in the expression fun1() + fun2()

  • @SsSs-nr2nt
    @SsSs-nr2nt 4 роки тому +2

    good initiative

  • @qwertyuiopasdfghjkl4211
    @qwertyuiopasdfghjkl4211 5 років тому

    Output is true, because relation operater will return only true or false, here will perform because it is left to right associative both are returning true and both == same.

  • @apnakaamkaro2644
    @apnakaamkaro2644 5 років тому +4

    Thankyou For these Lectures Sir :)

  • @vikramsingh-jb1xt
    @vikramsingh-jb1xt 6 років тому +2

    Don't know, because (a c) is also true and return non zero. And finally if(non zero == non zero) sometimes equal or not equal. Therefore I can't predict the answer all times. So it may be compiler dependent.

    • @fuzailmohamed8619
      @fuzailmohamed8619 6 років тому

      No it is not the case, when a given condition becomes true it returns 1,when it is false it returns 0, here 1==1 true is printed.

    • @prashant1206
      @prashant1206 6 років тому

      but in relational operator(==) non zero value is taken as true so, true(any non zero value)== true ,
      so result is true..

  • @mauryaashish1865
    @mauryaashish1865 3 роки тому +2

    You are insane man!! 🔥🔥🔥

  • @deepakbhardwaj3141
    @deepakbhardwaj3141 6 років тому +4

    U r awesome Sir doing a great job....

  • @sohamshinde1258
    @sohamshinde1258 4 роки тому +2

    I just dont understand how the brains of the people who have disliked the vedio work, really I don't just get it. May be undertanding them is more complicated than C language.

  • @shubhammahajan6696
    @shubhammahajan6696 6 років тому +55

    if u work like this so we'll no need of rbr sir paid lecture

    • @fun2shh899
      @fun2shh899 4 роки тому +3

      true bhai

    • @rishabhchakraborty2628
      @rishabhchakraborty2628 4 роки тому +1

      Exactly, his course is not worth in terms of depth. He just makes everything memorise.

    • @mrunmaidahare8477
      @mrunmaidahare8477 3 роки тому

      are these lectures better than rbr sir paid lecture? plz tell

  • @varunsharma2876
    @varunsharma2876 4 роки тому

    This the best channel👌👌👌

  • @payalkumari3825
    @payalkumari3825 2 роки тому

    Explain various operators with its precedence in c.
    Explain various operators in c.
    Sir this two questions are same or different

  • @hemanthsunny983
    @hemanthsunny983 28 днів тому

    Homework answer : TRUE

  • @nitishaagrawal8629
    @nitishaagrawal8629 6 років тому +1

    Sir ,Plz upload more videos on loops,arrays n all the topics of C language, U'r videos are helping me a lotttttt bcozz..Plz..

  • @josuegisber8150
    @josuegisber8150 2 роки тому

    Answer is: TRUE. Why? Because relational operator ( < , >, >=,

  • @Steeve.smoker
    @Steeve.smoker Рік тому

    Sir.u pin correct answers.and I enjoy ur series ❤❤

  • @ytkids8
    @ytkids8 3 роки тому

    Output: True

  • @vaibhavsingh2726
    @vaibhavsingh2726 4 роки тому +1

    It ' ll print true

  • @surajmangasule980
    @surajmangasule980 3 роки тому +1

    Answer is true

  • @njaliShinde
    @njaliShinde 4 роки тому +1

    If condition is true
    True==True that is
    1==1
    o/p:True

  • @Tara_Sutar
    @Tara_Sutar Рік тому

    @ 14:28 example, Why is Neso Academy bring printed ?
    1) variable "a " is an type.
    2) The function is returning only 1 not Neso. and why does it return Neso ?

  • @rishabdas1092
    @rishabdas1092 4 роки тому

    True as all the parenthesis have same associativity...

  • @MohitK96
    @MohitK96 6 років тому +6

    everyone underestimates precedence and associativity without knowing that they are the most important topics...

    • @waverache8296
      @waverache8296 5 років тому

      Right

    • @tawseeftaher4446
      @tawseeftaher4446 4 роки тому

      mohit,vai...
      i can't memotize this associativity & precedence table. Please help me, if possible

    • @Fun_Jet
      @Fun_Jet 4 роки тому +1

      @@tawseeftaher4446 practice bro... Do practice

  • @Gun_ge
    @Gun_ge 2 роки тому

    (a c). true == true true

  • @noone0978
    @noone0978 Рік тому

    true will be answer
    btw sir, do we have to learn the table?

  • @adriancardosa2448
    @adriancardosa2448 3 роки тому

    Advance happy 1m subs ♥️ from Philippines

  • @mahtabalam5354
    @mahtabalam5354 5 років тому

    great teaching sir

  • @nimisharawat9949
    @nimisharawat9949 4 роки тому +1

    Just apply BODMAS or BODMASModulus in calculations.

  • @ronitmishra8917
    @ronitmishra8917 5 років тому +1

    You work is really outstanding. I would appreciate if you could post all C related videos before 2nd feb' 2019 (GATE).

  • @shraddhaaasne3915
    @shraddhaaasne3915 3 роки тому

    sir please make more videos on basic c programming.

  • @manojbasam6732
    @manojbasam6732 5 років тому +1

    Great job sir

  • @mahavirsingh5790
    @mahavirsingh5790 5 років тому +4

    output is true

  • @NMAJJINEERAJA
    @NMAJJINEERAJA 4 роки тому

    True is the answer

  • @sky-soft-2024
    @sky-soft-2024 Рік тому

    answer is : TRUE

  • @vikashdwivedivlogs8648
    @vikashdwivedivlogs8648 2 роки тому

    Answer is :- True