 Hello friends, I am Sanjay Gupta. And I welcome you again on Sanjay Gupta Tech School. So this is lecture number four. And in this lecture, the topic we will discuss is operators. And along with explaining the operator, I will tell you an example of how we use operators. And in the last video, we saw what are the data types and how we use them. So I also told you an example. If you haven't seen the lecture and you want to see my previous lectures as well, so that you can cover the entire C programming video series in Hindi. So for that, in this video and in the description of every video, in any of my videos in Hindi or English, I have put the playlist links in the description. So you go there and open that playlist and you will get all the videos arranged in one order. So now let's not waste time. One more information before you want to take online classes from me or you want to clear any doubts. So along with commenting in the video, you can also use my email or WhatsApp information. So let's start. So first we will discuss what are the types of operators and then I will tell you an example of each symbol so that you can understand it properly. So let's talk about the definition first. So an operator is a symbol which is used to evaluate an expression. So now let's see what is an expression. So in front of you there is a statement written C equals to A plus B. So you must have written many such equations in your maps. So let's talk about programming or C programming. So here we call them expression. So in this expression, we have used two symbols. One is equals to and the other is plus. So if we see below, here equals to and plus are operators and ABC are operands. So now ABC are operands. So operand can be variable or constant. So the expression written here is C equals to A plus B. You can write it as C equals to A plus 5. So look here A and 5 are operands but A is a variable and 5 is a constant. So that is why it is said that ABC are operands and equals to and plus are operators. So in the definition you have seen operator is a symbol which is used to evaluate an expression. So to evaluate this expression, we will solve the plus first. Then we have to assign the result further to C variable. So this was a basic introduction about operator. So you must have understood that in any expression, we will use any symbol which is basically an operator. And in programming, every operator has a unique meaning. So we have to consider them individually. Before that, we will have to identify types. So now the type we are seeing here is based on operands. So operand as I told you ABC means like variable or constants. So if there is one operator and only one is operand then what will be the operator? Unary operator. So if you have used one operand and one operator it means that is unary operator. If you have used two operand and one operator it means that is binary operator. And if you have used three operands and two operators it means that is ternary operator. So now let us see an example of this. For example, if you have constant in the left variable and constant in the right, then this is binary. Now do not understand that if we have written this, then this is ternary. We will solve one operator at a time. So to solve one operator, you will have to decide how many variables or constants and how many operands will be required. Whether it is binary or ternary or unary. So to evaluate the plus there is a and b requirement. Then the result of these two will be added with c. It means here we have used plus twice so that is two binary operators. So do not understand that this is ternary. So now you are thinking which is ternary and which is unary operator. So now to clear your doubts, let me give you a small example. If we write a plus plus then this is unary. Because here we have used a variable and plus plus is a combined operator. Now in detail when we look ahead you will understand its use. And ahead we will use one more combination. This is expression 1, expression 2, expression 3. So these three are operands. And the question mark and column will be operator. And all this will be evaluated together. So this will be ternary. So now to clear your doubts on your basic beginner point. But we will read it in detail. So you have become a mindset of unary, binary and ternary. If there is one variable or constant then it is unary. If there are two then it is binary and if there are three then it is ternary. Now this is the basis of operations times. So now I have written a plus plus on the fourth number. I have written the question mark and column on the sixth number. So these are the category of unary and ternary. The rest are mostly the category of binary. So now we will pick one by one and use all the operators step by step. So first we will take arithmetic operator in which there are five symbols. Plus, minus, multiply, divide or modulus. So now we will implement a small program so that you can understand its use. So I have written int a, b, c. In a there are five and in b there are three. Now we can write c equals to a plus b. This is very easy. We can write c equals to a minus b. This is also very easy. Which you have already used in mathematics. Because if you want you can also create the result. Now equals to percent dc. Then here again there will be a new value in c. So you can select print f. Oppression equals to percent d. Then again c equals to a multiplied. So here there will be multiplication. So let's get it printed. Next step divide. So c equals to a divide b. So here you have to keep in mind that what will be the divide? Potient value. Potient means result. And here we are using integer data type. It means the value in a and b The result of that will also be integer. And that will be stored in the c variable. So in a there are five and in b there are three. So when you divide five from three, that will be one time divided. But if you look at it mathematically, there is one point something. But in programming data type has a very important role. So if your variable is integer type, the result will also be integer. It means what will be the print? It will be one print. So divide equals to percent b. So the divide will be one print. Then last is a. Then percent b. Now this percent symbol is new in programming. And what does this calculate? Reminder value. And its name is modulus operator. So whenever you see percent symbol, you have to keep in mind that its name is modulus operator. We call it mod operator in short. And its work is to get the remainder value. So when we divide two numbers, and both are integer type, then we will not borrow the point there. So some value will remain. For example five foot three. I will open the paint and explain to you. For example let's draw. I have to divide five. So I have to divide five. I have to divide it from three. So it will be divided once. Here I have written three. And how much remaining will be left? Two. So this one is as a quotient. And this two here is as a remainder. So what symbol will you use to get the remainder? You will always use percent symbol. So whenever you use percent, what will you get? This is the remainder value. And whenever you use divide sign, what will divide you? This is quotient. So whenever we apply division operation, we get two results. A quotient and a remainder. So the quotient you will get from this divide. And the remainder you will get from this. So what is the remainder? Two. So let's print it out. So I have written mod equals to percent d and c. And every time you see c value is being modified. But value is fixed in a and b. We have changed that. So we saved it, compiled and run it. Now you have seen the output. We have also written a plus. So five plus three is eight. So sum eight has been printed. So five minus three has been printed. Multiplication of five into three is fifteen. Division. As I told you in the division, we will divide five into three. So the quotient will be one. And the remainder will be two. So it is the same here. You can see. Divide is being printed. One and modulus is being printed. Two. So in this way, you can use these five symbols for calculation in programming. So I hope you have understood this. Now we will pick another category that is relational operator. So in relational operator, these six symbols are less than greater than, less than equals to, greater than equals to, double equals to and not equals to. So now we will try to understand them. So now how will we use them? You have used them in maths. But we will get some more symbols available here. So I will mention the comments. Less than you have used. Greater than you have used. You have used less than equals to. You have used greater than equals to. Now we have to compare. We have to compare the two entities whether they are equal or unequal. So they are equal and double equals to. They are unequal and not equal. So I have mentioned them with the help of comments. Now you have two variables you have to compare them and we have to apply the comparison. So in programming, we will use a keyword if and we will write it this way. If a greater than b you can print it here. a is greater than b. So what is this if and how it works. We will read it in detail in the coming video. For now, you just have to know that condition testing is useful. That condition is true or false. And whenever you have to check the condition for comparison, then you have to use these relational operators. So now see a greater than b. If this condition is true, then it will be printed. If condition is false, then it will not be printed. So I will save it and run it. So you can see in the output that it is printing a is greater than b. That means condition is true. So you have seen how I have used a greater than sign here. Similarly, you can use less than you can use greater than equals you can use less than equals you can use double equals and not equals to b. So for example, if I do the same value, I have modified the message and I have taken a double equals to b. Now we will save it and run it. So it will tell you a is equals to b. So always keep in mind that when you have to compare two entities in programming, then you have to use double equals to b. And you have to check that they are not equal and then you can write a is not equal to b. So this sign is completely new for you. So we will call it not equals to b. So now this condition will be true because a is not equal to b. So it will be printed in output. a is not equal to b. Okay. So whenever you have to comparison, then we use these relational operators. So this was the second category. Now let's go ahead to the third category. In the third category is a logical operator. So in the logical operator, we are using three symbols. So first let's know what they are supposed to know. So just write the symbols in the comment. And then write the symbol here. And then write the symbol here. And then write the symbol here. तो दोनोंमे से तोई बी एक पाल से, तो रिह्वर्त आए काईगा तो वो तेबल यहा बनाजे के लगका वोचछ वहते है तो उस में होगा, जो जिस िुण वचरतू खाल, तो अन लेव, जो जिस आद के गेस में क्या उखछा आए आप दोनोंं कदीशन् होगां तो ही आंध तो लूगां, अगर वायाईजन अई, जब लीग सत्ते हैं, आप दोग सर्फ एक क Mister Ke is true. Right! now you can imagine how you will use them in programming So I had just told you this condition. Let's explore this one If we write A greater than 2 and check b greater than 1 I have two scenarios You will use the end like this When you want to join more than one, you can use the end or the logical meh na apko niche bathai diya ki, conditioning 1 true ya falls, kundition 2 true ya falls hai, to uske base pare apko ye truth, table ko use karna padega, chaike, so abhi dikhna Hai a greater than 2 a2 se bada hai and b 1 se bada hai. perchaki a meh 5 a r b meh 3 hi to dono conditioning true o ri hai, it means yeh jo true partner nye jobi massage ap like hi mo print hot, so on na litya true, true hi print karna ho liye hai, दोकँन्टा प्रेंटगे यवाशी धवाशी बदहाँ आफ़दख़ाली किस शब छुगवळाशाँ, अपनी आपनी पिरच्छग गवा कोत्दखाज़ाँ और थो आपनी अखववाशी खवाशी, जो आपनी आपनी वईषवाशी, आपनी भवाशी विषरिया ख्छफ्छ एक सकता है कुछ भी प्रय्द नहींज नभा कुछी ढोनो में से एक कुछिँ आप नहींज पाल से और ड़ क्या केप आप दोनो के डोनो त्रूण है जी �バगगगे अब आप चाता है कि डोनो में से एक भी प्रूग है तो आप उपल्ट प्रट होँजाना जिये तो आप आन्द के पलेस्पर क्या यूस कर लेंगे और तो आप ये फुस्ट वाली कंटिशन तू है, सेकिन वाली कंटिशन पूल्स है बत फिर भी ये आूपकोट आपके स्क्रींपर प्रेंट हो जाएगा देखो, तू यहा प्रेंट होगा तो आप ये जो तेबल है, ये बहुत बहुत अप, ये अगर दो कंटिशन कर दूनों कर तू है, तो आन्द के किस में तू हो जाएगा, बत अगर अपने लोजिकल और यूस क्या हो आप, तो तो दोनो में से कोई भी कंटिशन अगर तू होगती है, तो भी रेजल तू होगती है, चिके, तो ये समझ में आगर अगर आपको तेबल की आल्प से, इसको हमेंशा दियान रख है, ये बहुत थेबल है, और जब भी एख से ज़ादा कंटीशचन यह वोंगी, कबी नखपी अएड और को यूस रहागगा।, ज़़ भी वोड आपने चाथ ताने, अप बबाद खरते है, नोथ तूब, नोथ का थुट. तेबल से कोई लेडेना नहीं है, अप र linguistic अप � certains प्रचात दोग創्ध देंगई नास़ınız तो � improved अत्रभैद प्स होता एक मंडों बोग क्तें लिए. Wherever प्र प्र घेंगा लिए, अाप योग सक्देड क्या। नद देजन्सChar approx प्रचात दोग तो if you understand what I am telling that वह मैं क्या क्या चारना चारावां आगा जाँ्ताying or bress about the display the values of A and B विपना प्या कि यहे देखा। But as I said pre increment which is to increase the variables first � obt the value of the values on other variables. So A became 6, and B became 6 तो उसको र होगा कर के देख लगा थाज़ो, look at A as 6 and B as 6 भी मेगी desperatives, उरह सुर्ऽा को लिग कि कॉताregierung कमारां। रीवे उी पास Geg used up first out is set equal to 666 after 1 output then timeِّ is minus then A will be 5 in 5 asin's first we are going to print it is 666 but then 5 this means pre increment is applied in increment legitimate असे ठीरे भरयेंगल एक �versa viaryaile तो सकते घेखाने संपम फ़नाी तरम से ऐसालन से क्यों। नहीं पन से नहींनाय देखाने अपनी वा braking विरнизचम सि� brown क правильно � nik और शयान तरम से प्isésज लगी तरमabor तए मैं आन आपा पता है की, A अपनी वल्यों B को देूहाए, तो A हो, A आपनी वल्यों B को दी, तो B हो गया 5. और, आग्ली लिन में पहोचने के बाड आप आप पने अप को इंक्श करेगा, तो A उजायगा 6. तो इसको सेव करकेटे रन कर के ने किजेद है, तो दिखने आप द़गा वल्गियद, बी क्यर आग्या पाई़, इसी लेस को क्या बूलते है, पोस्त अंख्रिमेंडेक्रेमेंद, की हमने अपने आग्यो वेरिएवल की वेल्टी, करंट वेल्गी थी, वेको देदी, और फिर बाद में उसको प्वहींट करवागी।, जब � उस्तिया लाई में आप ऋन्क अगा दूग. आप यहा पर किया रिए रेए लोग लैक, एक आसान यहाँ, बीगा उस्तिया लेक, अप डि़े आप एक गा चआए लेक. अप आप बाखी को भी यूज कर पाएंगे यसी तरीके से। और नोरमली हम नहीं को यूज नहीं करते पी कि भोत चोड़ा सा चेंज आता है बट आप को पताओन अचेगी ये भी अपलेबल आप प्रोगानें के अंगर अप बट आप को पताओन अचेगी ये भी अपलेबल आप प्रोगानें के अंगर अब लास्ट हम दिसकस करेंगे कनटीशनल अप्रेटर, जो की तरनडी अप्रेटर अट प्वश्टंभार के ईंखोलन अपन देखते है कि हमें 2 वेर्यबल की वालिएको कमpear करना है तो मैंने इपके तु कमpear करना बताया था अब हम कमpear करेंगें वेर्यबल के तु सुरी इन अपरेटर सके तु तो मैंने लिखा एग गरेटर दं भी वश्टिन माग प्र लिका प्रिंट्टोग प्रिंट्टीश मेखस प्र लिका खलम प्रिंटट्टीश मेखस छे को आप देखो ये है अपना अपरेट बान ये कन्dition ये एक्प्रष्शन नी फिर आगया अपरेटर सिмबल कुष्टिन माग फिर आगया एकष्चशन 2 विर आगया आपरेटर कोलन और और इक्प्रेशन तुग्ये एक्प्रेशन तरीग आपर वाली है कि अगर ये तूफुती होती है, जे वाला पार चलेगा अगर हि ये कि ये फुल्स होती है ये वाला पार चली इस टीके से जो उस चो लिए क्ष्टी में वम गगिल उते और क्योता है, थी fathers of operators of arbitrators, it will know which operator should be opened before तो उस में आपको प्रस्टन्स और असोचीट्विटी दोनो अप्डिलबल हो जाएंगी तो उसको देख है, तो इस तरीके से मैंने इस भीटीो लेक्चल में अप्रेटर्स के बारे में आपको बताए, अप्रेटर्स के बोसरे इजामपल सापको इस्प्लीन कर के बताए तो आई फोप की आपको जोभी में इस्प्लीमेशन दिया वो समज में आया अवगा