C_21 Operators Precedence and Associativity in C | C programming Tutorials

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • In this Video, I have discussed Operators Precedence and Associativity in C Language.
    Best C Programming Tutorials : • Programming in C
    *******************************************
    Connect & Contact Me:
    My Second Channel Link: bit.ly/354n7C7
    Facebook: / jennys-lectures-csit-n...
    Quora: www.quora.com/...
    Instagram: / jayantikhatrilamba
    Twitter: / khatrijenny
    *********************************************
    More Playlists:
    C++ Programming Tutorials: • Lec 1: How to Install ...
    Placement Series: • Placements Series
    Data Structures and Algorithms: https: • Data Structures and Al...
    Design and Analysis of Algorithms(DAA): • Design and Analysis of...
    Python Full Course: • Python - Basic to Advance
    Printing Pattern in C: • Printing Pattern Progr...
    Dynamic Programming: • Dynamic Programming
    Operating Systems: // • Operating Systems
    DBMS: • DBMS (Database Managem...
    #cprogramming #jennyslectures #programming #clanguage
    #operatorsinc

КОМЕНТАРІ • 514

  • @shivangikumari2231
    @shivangikumari2231 Рік тому +186

    --a*(5+b)/2-c++*b
    --0*(5+1)/2-(-1)++*1
    Firstly we evaluated which is written in bracket
    --0*6/2-(-1)++*1
    Now we evaluate postfix increment op
    --0*6/2+1*1
    We write +1 bcz in postfix firsly value assigned then value incremented
    After postfix increment we evaluate prefix decrement
    -1*6/2+1*1
    We know that * and / has same precidence and associativity is from left to right
    -6/2+1*1
    -3+1*1
    We know that +has lower precidence than * then * evaluated first
    -3+1
    =-2
    Hence answer is -2

    • @ShubhamSharma-zq2xn
      @ShubhamSharma-zq2xn Рік тому +18

      For me it's the ever most helpful comment, that I ever read on this earth. Ya, there are some gems on earth, in which you are the one. Smile because you're unique. Thanks for helping me out to understand it in form of a comment 😊

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

      can you explain the post fix increment. -1++ is 0 right?

    • @shivangikumari2231
      @shivangikumari2231 11 місяців тому +8

      @@aakashyericharla8668 no this is not right bcz in postfix firstly we put value then incremented
      That means (-1)++=-1

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

      Hi, can u explain what is post increment and dercrement after the step of 5+1 pls. I am school student.. I will be grateful

    • @shivangikumari2231
      @shivangikumari2231 11 місяців тому +6

      @@kkkkkkk754 in post increment we firstly assigned the value then incremented.
      Eg. int a=2;
      printf("a=%d",a++);
      It gives output a=2 then a becomes 3.
      In post decrement we firstly assigned the value then it is decremented .
      Eg. int a=2;
      printf("a=%d",a- -);
      It gives you the output a=2 then a becomes 1.
      Hints:-
      Incremented means plus 1
      Decremented mean minus 1

  • @aayushthakur6159
    @aayushthakur6159 3 роки тому +155

    Q . --a * (5 + b) / 2 - c++ * b
    given a = 0, b = 1, c = -1;
    ans = -2
    explaination-
    firsty bracket will be evaluated
    so it will give 6
    now evaluate --a, it will give -1 since we are pre decrementing 0
    now, -1*6 = -6
    now -6/2=-3
    then -3 - (-1)*b(due to post fix the value of c will remain same )
    will give -3 +1*1(since b is given as 1)
    hence -3+1=-2 ans

    • @saikrishna8431
      @saikrishna8431 3 роки тому +14

      After brackets c++ na postfix increment has higher precendence that. Prefix

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

      Thnx for ur gd expln abt the c++

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

      Wrong ans

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

      He is right you can compile it

    • @lyricist3845
      @lyricist3845 3 роки тому +32

      @@rutujajadhav1782 I got -3? is it correct

  • @BodhiiDharma
    @BodhiiDharma Рік тому +28

    Shortcut to remember the operator precedence table in C…
    Use PUMA' S REBL TAC. ( spell "REBL" as if "REBEL").
    (Note: all operators with associativity not specified is left to right).
    P - Primary
    U - Unary
    M - Multiplicative
    A - Additive
    S- Shift
    R- Relational
    E- Equality
    B- BitWise ( & > ^ > |)
    L- Logical ( logical && > logical ||)
    and the last three operators are
    T- Ternary
    A- Assignment
    C- Comma
    If you need a shortcut for Assosiativity then "AUTo rides in the right side", meaning Assignment, Unary and Ternary operators are Right to Left, O is added for completion)

  • @Dr._Aniekan_udo
    @Dr._Aniekan_udo 2 роки тому +58

    Ans = -2
    - -a * (5+b) / 2 - c++ * b
    - -a * 6 / 2 - - 1 * b (#(),++,#)
    - 1 * 6 / 2 +1 * b (#- -, -,# )
    - 3 + 1 (#* ,/ ,*#)
    - 2 (#+#)
    Operation done on the previous line is commented with # inside the bracket in the new line, in other of operation precedence and separate by non-computing commas.
    I didn’t use compiler anyways, but you are free to point out mistakes if found😅

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

      You didn't increment the value of c by 1.

    • @Dr._Aniekan_udo
      @Dr._Aniekan_udo Рік тому +8

      @@omarfaruque1095 it was a post increment, so c was evaluated before being incremented, as such it remain as -1 as shown in the second line

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

      @@Dr._Aniekan_udo apt. Followed the same reasoning and compiled to verify my answer

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

      I think it's after the program runs for the first time, then when it runs the second time it will increment to 1 because it's a postfix. That's how the postfix program runs. If it was a prefix it will increment from 0 to 1 the first time it runs.

    • @Narratesmart
      @Narratesmart Рік тому +2

      Thank you sir

  • @nithiya8418
    @nithiya8418 3 роки тому +32

    Mam ur DS playlist really helped me a lot for exam prep... please make a playlist for Computer architecture also mam... the subject sounds so vague pl help mam... 🙏🙂

  • @BITPrateektrivedi
    @BITPrateektrivedi 3 роки тому +17

    Waiting from last 5 days.. Happy to see you in my notification 🙂🙂

  • @susova2432
    @susova2432 Рік тому +13

    --a will decrement the value of a by 1 and return the new value (-1).
    5+b will add 5 to the value of b (which is 1) and return 6.
    --a*(5+b) will multiply the result of step 2 by the result of step 1, which gives -6.
    /2 will divide the result of step 3 by 2, which gives -3.
    c++ will return the current value of c (-1) and then increment it by 1 (to become 0).
    c++*b will multiply the result of step 5 by the current value of b (which is 1), which gives 0.
    -3-0 will subtract the result of step 6 from the result of step 4, which gives -3.
    Therefore, the output of the expression --a*(5+b)/2-c++*b will be -3.

    • @ElectricalsSolutions
      @ElectricalsSolutions Рік тому +1

      but -2 is given by computer

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

      ​@@ElectricalsSolutions -3+1 will become -2

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

      Wrong

    • @manojess
      @manojess Рік тому +4

      C++ means post increment so value of c used is -1 but in output in you print c you will get zero. In program c=-1 will be used. Now you will get -2 as the answer.

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

    Compiler Answer : -2
    but what i understood from your lecture:
    int a=0,b=1,c=-1;
    int k= --a *(5+b)/2-c++*b;
    --a *6/2-c++*b
    --a *6/2-0*b
    -1 *6/2-0*b
    -6/2-0*1
    -3-0*1
    -3-0
    -3
    tell me where i am wrong??

  • @yeshwanthrajsp5876
    @yeshwanthrajsp5876 3 роки тому +12

    teaching "extraordinary, fanstatic and mind blowing mam salute mam😇"

  • @tps8470
    @tps8470 2 роки тому +8

    Ans is -2
    Thanks a lot Mam

  • @Mister.G181
    @Mister.G181 9 днів тому

    --a*(5+b)/2-c++*b
    here, a=0, b=1, c=-1
    --0*(5+1)/2-(-1)++*1
    brackets, postfix have the same precedence(highest), therefore we have to go from left to right
    --0*6/2+1*1
    now the prefix has the highest precedence in the above expression,
    -1*6/2+1*1
    now * / have the highest precedence in the above expression, to break the tie we from left to right,
    -3+1
    now + has has the highest precedence in the above expression,
    -2
    We have the values of the variables as,
    a=-1, b=1, c=0

  • @tusharsonawane3530
    @tusharsonawane3530 Рік тому +4

    Excellent teaching mam , no words for your teaching

  • @18fatima15
    @18fatima15 6 місяців тому +1

    11:03 #include
    int main()
    {
    int a=0,b=1,c=-1;

    printf("%d",--a*(5+b)/2-c++*b);
    return 0;
    }
    output: -2
    working: --a*(5+b)/2-c++*b => -1*6/2+1*1 => -3+1 => -2

  • @sumitkhursange2673
    @sumitkhursange2673 3 роки тому +19

    Mam your videos is easily understandable for me on UA-cam platform... Thank you mam for this course🙏

  • @herteert299
    @herteert299 Рік тому +2

    Your work is awesome Mama. Your courses of the C language are the best I found on the internet.

  • @whathuh6965
    @whathuh6965 Рік тому +9

    You're really good at explaining things clearly. Good job.

  • @saibalam7852
    @saibalam7852 3 роки тому +3

    Mam ur teaching is marvelous this is what a beginner expects

  • @hulkcochulk6486
    @hulkcochulk6486 Рік тому +2

    int a=0,b=1,c=-1;
    - -a * (5+b)/2 - c+ + * b.................. ['/ ' is higher precedence than '*']
    -1 * 3 - -1 * 1.......................... [value of a will increment first , c is now incremented to 0{-1+1=0}]
    -3 - -1..................['*' have higher precedence value than '-']
    -3 + 1 = -2 ( output)

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

    -2 is my final answer
    a= -1
    b= 1
    c= 0
    If it is right please let me know jenny mam

  • @hadieudonne433
    @hadieudonne433 3 роки тому +29

    Welcome Back and HnewY 2021 Lecturer Jenny, wish you higher advancement in this year and I promise you to be a good programer because of you.
    Step by step any thing is possible

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

      Thank you so to press like on my comment, now I want to invite you if possible to press follow on my instagram which is instagram.com/hadieudonne43 🤦🤦🤦🙏

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

      ua-cam.com/video/qI29eAhdJIc/v-deo.html

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

    Watched your whole ds algo videos...
    Really helpful for me..
    Keep making such videos🙏

  • @emiliarose1980
    @emiliarose1980 2 місяці тому

    Big thanks to you ma'am , what a smoothness and how u can transmit ur knowledge is just amazing 👏 👌 ❤

  • @chandrashekarr1977
    @chandrashekarr1977 3 роки тому +3

    Nice one. Thank you.
    This part need more clarification and workouts as most of the entrance exams have bunch of questions from this area.
    To my knowledge, none of the books in market covering this area fully. There is always a grey area where people get confusions.
    If possible, please comeup with more videos with more sample questions from placement question papers and show with step by step explanation in detail. Thanks once again.

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

    dear mam thank you will be very less for your videos , praying for all happiness n success to u n to ur family , i m benefited a lot by your videos , you are an excellent teacher

  • @sagar1216
    @sagar1216 3 роки тому +5

    Videos are good as talking about the explanation, but I am wishing project based tutorial as these videos totally like as some online Computer Engineering Quick Guides. If you could do it I would be very thankful to you ,MAM!, as I am just in 9th. Please..

  • @chaitanyapaidi7396
    @chaitanyapaidi7396 3 роки тому +5

    I just watched your previous videos of many months before and you know what you have become chubby and cute 😍😍❤️.....love from South India ❤️❤️🔥

  • @Pramiti_Choudhury
    @Pramiti_Choudhury Рік тому +4

    do we have to learn this???to solve, but how will i learn such a big table? any short trick? like bodmas or something?

  • @manvendra91102
    @manvendra91102 3 роки тому +3

    Best teacher ever

  • @1shAggarwal
    @1shAggarwal 2 роки тому +51

    You have a great way of teaching but i want to say that I laugh 🤣 when you scream 'now' out of nowhere 😆.

  • @xiiscb-42subhalakshmisarka41
    @xiiscb-42subhalakshmisarka41 Рік тому +3

    Am getting -3 as the ans

  • @HariomSingh-nc6uh
    @HariomSingh-nc6uh 2 роки тому +1

    Maam u r soo cute
    And through your teaching pattern I'll learn more and more....
    U r amazing😍
    Love from FoET lucknow CSE(AI). ❤

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

    Thank you so much mam
    aap kitna hard work karti h mam

  • @musiclovers11706
    @musiclovers11706 9 днів тому

    Mam u r so pretty..❤ and a good teacher also..😊

  • @khushikumari-fun
    @khushikumari-fun Рік тому +1

    -3 will be correct answer..
    --a * (5 + b) / 2 - c++ * b
    given a = 0, b = 1, c = -1;
    --a * (5 + b) / 2 - c++ * b
    -1*(5+1)/2-0*1 (--a becomes -1,The value of a is updated to -1 becuase its a prefix dcrement and c is postfix increment so it will be update -1 to 0).
    -1*6/2-0*1
    -1*6/2-0
    -6/2-0
    -3 ans................

  • @nukavarapusrikrishna714
    @nukavarapusrikrishna714 11 днів тому

    Tq mam clearly understood 😊

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

    I have seen c programming topic video. Amazing presentation.

  • @Ganesh222
    @Ganesh222 Рік тому +1

    You are a very experienced and skill in teaching mam .... really

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

    Mam thanks 😊 .
    I m beginner 🔰 mam give a video how to start

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

    Best teacher i have ever seen

  • @rajshreesharma6778
    @rajshreesharma6778 Рік тому +2

    ans = -3
    is it right ?

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

    Happy New Year Madam G.. Thanks Jii

  • @d.shabanaz337
    @d.shabanaz337 3 роки тому +4

    Sister plz Jarvis Al tell us how to do as your teaching is very understandable and interesting and easy to learn

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

    Great Guide ma'am
    Keep Spreading knowledge 🥰

  • @shacks05
    @shacks05 3 роки тому +3

    I kindly Request . To Pls Make Videos on Python As soon as possible mam ❤️ . Because we are Addicted to u 🙏☺️

  • @caymannvelingkar7369
    @caymannvelingkar7369 3 роки тому +68

    Is FINAL answer -3?

  • @sanusain4989
    @sanusain4989 3 роки тому +5

    Mam discuss about Python course step by step please.....🙏🙏🙏🙏🙏

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

    Thankyou very much❤️

  • @Pinksky17
    @Pinksky17 Рік тому +2

    Answer is -3.

  • @kalisthamary1919
    @kalisthamary1919 2 місяці тому

    Very use ful
    I need online ' c 'course

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

    Thank you mam for the owsmful video🙏❤️

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

    Mam can u give a more clarity about postfix and prefix with an example

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

    I usually watch your videos they so well and I like them. thanks so much.
    I would ask you do you know anyone who would teach me data structure and java programming. I'm going to pay for the service.

  • @d.shabanaz337
    @d.shabanaz337 3 роки тому +5

    Sister after c++ course jarvis Al mam plz

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

    Great going mam 🔥🔥

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

    answer is -2 mam
    for the last expression

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

    Thanks a lot ma'am 😍😍😇😇

  • @Digitalkannada-v5i
    @Digitalkannada-v5i 3 роки тому

    a=o
    b=1
    c=-1
    --a*(5+b)/2-c++*b
    =0*6/2-c++*b
    =0*6/2-2*b
    =0-2
    =-2
    Ans is -2
    Thanks ma'am

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

      Post inc. Will increase value after that statement... That's why -3

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

      @@anjanhalder7164 can u plz elaborate?
      My output is just showing -2

    • @anjanhalder7164
      @anjanhalder7164 2 роки тому +1

      Ans is -2. I was wrong.

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

      @Prajwal @Anjan Halder @VISHAL AWATI Please tell me about the --a when the a is an integer and it's value can be -1 after the --a?🤔

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

      Wrong

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

    Thank you mam for your effort ...
    #friend_of_minds

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

    I could not solve why when a=0, b=1, c=-1 why --a*(5+b)--c++*b comes out to be -2

  • @anjanhalder7164
    @anjanhalder7164 2 роки тому +22

    What is the output? Mine is -3

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

    12.30-( answer is -2 mam)

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

    I was learning from u r vedios only mama

  • @prathamshirke7450
    @prathamshirke7450 3 роки тому +3

    Mam add more languages like C++ and JAVA please

  • @036rahulmishra9
    @036rahulmishra9 3 роки тому

    Nice maam ur inspiration for me

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

    Thank you

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

    Mam please check priority of postfix (++ and --) is left to right or right to left?????

  • @uttej1390
    @uttej1390 3 роки тому +10

    Mam next course plz add c++ course mam 🙏🙏🙏

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

      Thank u mam for 💓 💓 💓

  • @SahasraMuthyam
    @SahasraMuthyam 2 місяці тому

    What is the difference between uniary + and binary +

  • @RaniChoramale-e5w
    @RaniChoramale-e5w 8 місяців тому

    a=0
    b=1
    c=-1
    --a*(5+b)/2-c++*b ans=0 I dont no answer is correct .
    jeeny mam please the separate voide

  • @MahirRashid-ih1nz
    @MahirRashid-ih1nz Рік тому

    thanx you are great well madam.....

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

    My thanks goes to u mam

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

    Madam please upload solving towers of honoi problem in data structures

  • @gautamraju123
    @gautamraju123 6 місяців тому

    Mam please python programming video from basic

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

    Mam aap English kitna simple bolte ho 👌👌🤗🤗

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

    Nice teach mam ❤️❤️

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

    Mam do videos on python programming language

  • @world.of.october
    @world.of.october 3 роки тому +1

    so basically we check the associativity (if of the same priority) from the expression

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

    super i love you for ur teaching🥰🥰🥰🥰🥰🥰🥰🥰

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

    Super teaching mam

  • @user-kb9tz7pp9y
    @user-kb9tz7pp9y 3 роки тому +4

    Pls post the lectures in bulk!!!!if possible!!and u r the best after shukla sir!!

    • @RashidKhan-wj7cp
      @RashidKhan-wj7cp 3 роки тому +1

      Who is Shukla Sir ?
      May I know the channel name ?

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

      @@RashidKhan-wj7cp ua-cam.com/channels/D-scAE4ju78dld1kpcsQfQ.html

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

    Hey Jenny did you make a video how to deal with functions? Thanks!

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

    Thank you ❤

  • @SabaRani-s1o
    @SabaRani-s1o 10 місяців тому

    Thank you so much mam😊😊😊😊😊

  • @SaidabeeShaik-n2o
    @SaidabeeShaik-n2o Місяць тому

    Super

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

    Good explanation mam

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

    --a * (5+b)/2 - c++ * b
    Value will be -2

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

      How please explain

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

      Areh i compile this code in my laptop it is coming as 1 ..i didnt understood how 1 is coming

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

      @@learncseasily3385 Its -2 not 1.
      You might have compiled it wrongly.

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

      @@handekarilingojivarasaikri782 yes yes i got it by mistakely i have writen -a instead of - - a 😅

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

      ua-cam.com/video/qI29eAhdJIc/v-deo.html

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

    Awesome sister.... After C language kindly update a Playlist on oops based language C++ that would be more helpful sister... Thank you..

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

    Thank you so much

  • @krupa1963
    @krupa1963 3 роки тому +3

    12:40
    Answer : -2

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

      Can u explain?

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

      It is right answer

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

      @@shoba2212
      -1*6/2-(-1)*1
      -1*6/2+1*1
      -6/2+1
      -3+1
      -2

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

      C has postfix increment then y it still be -1, the value must change to 0 I guess..pls clarify

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

      @@madhukasturi9953 yeah I think ansr is -4

  • @deeprabasak345
    @deeprabasak345 2 місяці тому

    -2 is ans ....checked in ide

  • @shakib_saifi_2003
    @shakib_saifi_2003 6 місяців тому

    Thank you mam 😀

  • @kalisthamary1919
    @kalisthamary1919 2 місяці тому

    How to run c program in terbo c++
    Explain what are errors will come how to correct errors

  • @sachingupta-nm3vx
    @sachingupta-nm3vx 3 роки тому

    ta mam...lecture was quite good

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

    Ans is -2.

  • @hiriharanvm5568
    @hiriharanvm5568 3 місяці тому +1

    int main()
    {
    int a = 0, b = 1, c = -1,res;
    res = --a*(5+b)/2-c++*b;
    printf("%d",res);
    return 0;
    }
    ans is -2

  • @Machine_Forever
    @Machine_Forever Рік тому +1

    My answer is -2

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

    Thank you sow Match miss

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

    Output:-3

  • @kk8796-f1v
    @kk8796-f1v 3 роки тому +1

    mam please consider explaining functions and storage classes in c prog..... mam please please please 👨‍🎓👨‍🎓

  • @chunchegowda6481
    @chunchegowda6481 2 роки тому +1

    In manual calculation am getting a value as -3 but in compiler am getting -2, why it's so???

    • @alarezomoosamuyi8526
      @alarezomoosamuyi8526 2 роки тому +1

      apparently, even if you evaluate c++ first, since it is post fix, the value will remain unchanged in the expression, thus you'll have
      -1 * 6 / 2 - (-1) * 1