C_21 Operators Precedence and Associativity in C | C programming Tutorials
HTML-код
- Опубликовано: 2 янв 2021
- 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/profile/Jayanti...
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
You're really good at explaining things clearly. Good job.
teaching "extraordinary, fanstatic and mind blowing mam salute mam😇"
Your work is awesome Mama. Your courses of the C language are the best I found on the internet.
Watched your whole ds algo videos...
Really helpful for me..
Keep making such videos🙏
Mam ur teaching is marvelous this is what a beginner expects
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.
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
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... 🙏🙂
👍
Excellent teaching mam , no words for your teaching
Best teacher i have ever seen
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😅
You didn't increment the value of c by 1.
@@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
@@Dr._Aniekan_udo apt. Followed the same reasoning and compiled to verify my answer
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.
Thank you sir
Thank you so much mam
aap kitna hard work karti h mam
Best teacher ever
--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
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 😊
can you explain the post fix increment. -1++ is 0 right?
@@aakashyericharla8668 no this is not right bcz in postfix firstly we put value then incremented
That means (-1)++=-1
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
@@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
Mam your videos is easily understandable for me on RUclips platform... Thank you mam for this course🙏
Big thanks to you ma'am , what a smoothness and how u can transmit ur knowledge is just amazing 👏 👌 ❤
Thank you mam for the owsmful video🙏❤️
Waiting from last 5 days.. Happy to see you in my notification 🙂🙂
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). ❤
I have seen c programming topic video. Amazing presentation.
Great going mam 🔥🔥
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.
Thankyou very much❤️
Nice maam ur inspiration for me
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
Thanks a lot ma'am 😍😍😇😇
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..
My thanks goes to u mam
Thank you mam👍❣️
Thank u very much mam ❤️❤️❤️❤️❤️❤️❤️
Thank you so much
--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.
but -2 is given by computer
@@ElectricalsSolutions -3+1 will become -2
Wrong
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.
Ans is -2
Thanks a lot Mam
how i couldn't got it
Thank you ❤
Hey Jenny did you make a video how to deal with functions? Thanks!
Am getting -3 as the ans
ta mam...lecture was quite good
thanx you are great well madam.....
Nice teach mam ❤️❤️
Thank you
Happy New Year Madam G.. Thanks Jii
I kindly Request . To Pls Make Videos on Python As soon as possible mam ❤️ . Because we are Addicted to u 🙏☺️
do we have to learn this???to solve, but how will i learn such a big table? any short trick? like bodmas or something?
Thank you mam for your effort ...
#friend_of_minds
Hatsoff for ur hardworking.
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)
Great Guide ma'am
Keep Spreading knowledge 🥰
super i love you for ur teaching🥰🥰🥰🥰🥰🥰🥰🥰
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
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 🤦🤦🤦🙏
ruclips.net/video/qI29eAhdJIc/видео.html
Mam thanks 😊 .
I m beginner 🔰 mam give a video how to start
Thanks...
Thank you mam 😀
Thank you so much mam😊😊😊😊😊
Good explanation mam
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
After brackets c++ na postfix increment has higher precendence that. Prefix
Thnx for ur gd expln abt the c++
Wrong ans
He is right you can compile it
@@rutujajadhav1782 I got -3? is it correct
Mam how to decide the step is L to R, or R to L if both associativity is involved in ques
Super teaching mam
Thank you sow Match miss
Sister plz Jarvis Al tell us how to do as your teaching is very understandable and interesting and easy to learn
🤣🤣
Tqq Mam.
-2 is my final answer
a= -1
b= 1
c= 0
If it is right please let me know jenny mam
Thanks madam
I just watched your previous videos of many months before and you know what you have become chubby and cute 😍😍❤️.....love from South India ❤️❤️🔥
so basically we check the associativity (if of the same priority) from the expression
Osm vedio mam
Madam please upload solving towers of honoi problem in data structures
Mam why the associativity of ?: is right to left in ternary operators we first check condition which is left to right
Happy New Year mam 🎈🎈
I was learning from u r vedios only mama
ruclips.net/video/qI29eAhdJIc/видео.html
Mam can u give a more clarity about postfix and prefix with an example
Mam discuss about Python course step by step please.....🙏🙏🙏🙏🙏
mam please consider explaining functions and storage classes in c prog..... mam please please please 👨🎓👨🎓
Mam aap English kitna simple bolte ho 👌👌🤗🤗
Sister after c++ course jarvis Al mam plz
You have a great way of teaching but i want to say that I laugh 🤣 when you scream 'now' out of nowhere 😆.
😂
😂
🤣
.mam I have doubt that is ,- 1 is a operator or a character...
I could not solve why when a=0, b=1, c=-1 why --a*(5+b)--c++*b comes out to be -2
You are a very experienced and skill in teaching mam .... really
How can we understand between uneary + - and binary + - how can we find difference
Mam add more languages like C++ and JAVA please
Ma'am it your eighth video of variables
Ma'am when I run the programm using the variable: sum$12, it worked... however when I used % or sum%12 as a variable name it was showing error
kindly help
Yeh kaise hoga $ yeh symbol hain or + ek operator hain variable declaration time pe pre define keywords use nahi ker shakte
What about square bracket and curly bracket
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)
Super bro no need to see video
kis channel se padthe ho
answer is -2 mam
for the last expression
Mam do videos on python programming language
What is the difference between uniary + and binary +
Gr8
When u will finish this c programming
Good
Awesome sister.... After C language kindly update a Playlist on oops based language C++ that would be more helpful sister... Thank you..
Looking gorgeous mam🥰😍
12.30-( answer is -2 mam)
Can u explain?
How can we know that it is prefix or postfix operator .. Time 6:19
Love you mam
a-b/c(c*d$e) mam how to solve this question 🤔 does * and $ have same precedence
Mam please check priority of postfix (++ and --) is left to right or right to left?????
Left to Right
good
Madam ur looking osm🔥🔥
int ans;
int a = 1;
int b = 1;
int c = 0;
ans = a++ || b++ && c++;
mam is case me b and c ki value increment nhi ho rhi h...
&& ki precedence high h to wo pehle solve hona chahiye tha na..
but a increment krke logical or ka 1st true h esliye compiler aage ko nhi jaa rha h?
What is the output? Mine is -3
yup
-2 is the output
@@sahilyadav2146 is that correct
@@mani6896 yes
I too got-3👍👍