 Hello friends, I am Sanjay Gupta. I welcome you back on Sanjay Gupta Tech School. So, you are watching C-language video series in Hindi and this video series is for beginners. And in this video, we will discuss lecture number 8. So, let's recap a little. In the previous video lecture, I explained the conditional statements. So, I covered two topics, simple for IFLs. And I explained some of the programs. In this video, we will discuss two remaining conditional statements. So, third one is nested IF and fourth one is else IF ladder. So, after watching this video, you will get complete knowledge of IFLs. And again, first we will theoretically read both the topics. And then I will practically implement all the programs. And these are my details for online classes and any problem if you face. You can consult me through these details. So, let's start. First, let's understand nested IF. So, nested IF syntax is in front of you. First, I will explain it. Then I will explain else IF ladder syntax. And then we will implement programs related to both. So, syntax means rules. So, nested IF rule is in front of you. First, we have applied IF condition here. IF condition is true, then this is its true block. IF condition is true block. IF condition is false, then this is its false block. As we have already seen in the previous video. IF condition is true, then what happens? If it is false, then what happens? But many times such a situation happens that if condition is true, then we apply another IF condition in that true part. So, you can see that here. This IF condition, outer one, first IF condition, within that curly basis, we have made another IF block of else. So, first IF condition is true, then control automatically will go to second IF condition. If it is true, then it will be true block. If it is false, then it will be false block. And if the first condition is false, then automatically it will go to the last else block. So, if condition is true, then apply another IF condition known as nested IF. And we will see this practically. So, I will implement the same program as nested IF and L-SIF ladder in both ways. So, if we look at the syntax of L-SIF ladder, then here is the IF condition, this is its true part. And this is the false part of the IF condition, which is written in L-SIF. So, here you will see that if condition is true, then some statements will be run. But if the first IF condition is false, then in the L-SIF part, we have applied another IF condition. And this is its true part and this is its false part. So, what does this mean? That even if condition is true, then we can apply another IF condition. Through nested IF, which we saw in the previous syntax. And if condition is false, then we can apply another IF condition in the L-SIF block. And if you want, then you can merge both. There is one program in which even if condition is true, and if condition is false, then you can apply this in the L-SIF part. So, nested IF and L-SIF ladder can be made. So, in this way, I have explained you theoretically nested IF and L-SIF ladder. So, now let's pick our first example. Check a number for positive, negative and zero. So, let's go to the compiler. First of all, let's write a comment. Check positive, negative and zero. So, we will implement this same program through nested IF and also through L-SIF ladder. So, first of all, we have included header file. After that, we have declared a variable in the main function. Because we have to read only one number from the user. We have to check whether it will be positive or negative or zero. So, we have declared a variable here. Now, I am writing printf, enter a number. So, if the user will input a number, then we will have to write scanf. So, scanf percent d, m percent n. So, the input number in this way is stored in n variable. Now, we have to apply nested IF or L-SIF ladder. Through which, we can find out whether the number is positive or negative or zero. So, let's try nested IF first. First, let's try nested IF. Then, we will replace nested IF with L-SIF ladder. So, I am putting a condition here. n greater than equals to zero. Then, I have written L-SIF ladder. So, this is my block. Now, if the number is equal to zero or greater, then the condition will be true. The line number is written as 10. This will be true in two cases. Either the number is zero or it is greater than zero. But now, we have to identify whether it is zero or greater than zero. But now, we know whether it is zero or greater than zero. So, as soon as this condition is true in that case, then we will enter the IF and apply another IF. So, now, we have checked that the number is greater than zero. So, if this condition is true, then I am writing that the number is positive. And if this is false, then we can write that the number is zero. Because, we know that when this condition is being tested, then before that, this IF condition is true. And it will only be true in two cases, whether the number is zero or greater than zero. So, we have to check two things here. Whether the number is greater than zero or equal to zero. Now, the third case is negative. If the number is negative, then this IF condition is false. So, we are not running this IF or ELSE. Means, the first IF condition will be false. And the control will not be transferred directly to this ELSE. And we can write this ELSE directly. The number is negative. Because, positive and zero will be checked here. If it is true, then it will be printed through these two. If this condition is false, then we have only one case that is negative. So, we have checked it here. Now, you have three situations. Like I told you in the previous video, in the previous video, we checked only two situations. True or false. Now, we have three situations. Whether the number can be positive or negative or zero. So, whenever there are more than three cases, then either you have to use nested defuse or ELSE Flatter. So, this whole program has been implemented. Now, let's run it. First, I am entering the negative value. So, it has been printed. The number is negative. I have run it again. And I have entered zero. So, it is printing. The number is zero. And if I run it again and enter nine, then it is printing. The number is positive. So, in every case, the program has to work properly. Okay. So, this was nested IF. Now, let's remove it. And let's implement ELSEF. So, for that, A, sorry, N greater than zero. If the number is greater than zero, then it is directly printed. The number is positive. Okay. Just one case. If the number is greater than zero, then it is positive. It is sure. It is a reversal truth. So, we have printed that the number is positive. If it is not like that, then we have gone to ELSEF. Okay. Now, we have gone to ELSEF. So, ELSEF has two more situations left. The number can be zero or the number can be negative. So, we have written IF and less than zero. So, we have printed that the number is negative. Okay. Now, this IF condition can also be false. That the number is not negative. So, let's implement ELSEF again. Now, we have only one case left. It is zero. So, now, we don't need to implement another IF. When we reach this position, then you can write printF number is zero. Okay. So, if the first IF is true, then this printF will run. And the next one will not run. But if it is false, then we will go to ELSEF. After that, we will write another IF. Then, if the check is true, then this printF will run. If the condition is false, then this ELSEF will run. And this printF will run. The number is zero. So, in this way, ELSEF is a ladder. It means, we are making a CD. So, each and every step is being checked. Wherever the condition is true, that case will be executed. And if any condition is not true, then the last ELSEF is there. So, in this way, we implement ELSEF ladder. So, I hope that you have understood the implementation of both of them through the same program. So, whatever you think is easy, then use it. There is no compulsion that you have to use nested or any particular situation for ELSEF ladder. So, whatever you think is easy, then implement it according to the problem. So, let's move forward. Now, we have to find out max among three numbers. So, let's solve this first. Then, I will tell you how to use the logical end and other things through the same program. So, in the previous video, I had told you how to get maximum out of two numbers. Now, we will get maximum out of three numbers. So, let's do this. Let's declare three variables, A, B, C. So, printf will print this message. Tanf. And sunday, we will have to write it three times because there are three variables. A, B, C will store three different values in the three variables. Now, we have to apply condition testing. Now, let's check if A greater than B. So, if A greater than B, if A greater than B, then the condition will be true. Okay. So, if A greater than A, then we will have to check A from C. So, if it is true, we will have to apply one more F. Okay. So, in that, I have written A greater than C. Okay. Now, if this becomes true, then I am printing A is max. Else, I will print E is max. Okay. Then, here, else block will come. First, we have to understand if it is true block. So, let's see again, A, B. If we compare it, then we have to put values here. So, for example, A is five, B is two, and C is six. Okay. So, look, A greater than B. Compare it. A is five, B is two. Condition is true. So, we will come in. Now, we have checked A from C. A is five, C is six. So, condition falls. And we have directly printed C is max. So, now, you will say here that we have not compared C to B. So, what will we do for that? Look, we have compared A to B. And who is greater in both? A. And then, who is greater in A? C. So, won't C be greater than B automatically? It will be. Because A is greater than B. Okay. A is greater than B. And C is greater than A. So, C will be greater than B automatically. So, we don't need to check it. It will be printed automatically. C is max. Now, if C is four. So, look, A is greater than B. Because five is greater than two. And we have checked A greater than C. So, A is greater than C. So, who is greater than A? A. So, in this way, we will use nested if. And you will see that I will use else if. Like I told you that you can use the same program. So, you will see that. So, it is possible that A is greater than B. So, B is greater than B. So, condition is false. So, who is greater in both? B. So, if it is false, we will go to else. So, B is greater than A. But, who is greater than B? C. So, you have to use the same if else. And change these values. Now, compare B to C. So, if B is greater than B, then B is Max, otherwise C is Max. So, as we have checked here, we have compared B to C. When we reach to this else, then A is greater than B. Who will be greater in both? B. So, if B is greater than A and B is greater than C, then B is Max, otherwise C is Max. And three values should be different. There is a constraint here. ती लोग का एक्विलेटी चैक नहीं करते हैं ती लोग देख्रेंट हैं तो ये प्रोग्रेंट प्रोपरली वोग करें तो उसको कमपाईलो रन करते हैं तो मैं एंपुट कर रहूं 3,5,8 तो आप देख सकते हों A ता 3, B ता 5 और C ता 8 तो आप प्रोपरली वोग करें अब इस प्रोग्रेंट की लेंठ को रडीूस करना है मतले हम चाते है की इतने सारे एफल्स नहीं उस करनें और उसको थोड़ा रडीूस करनें तो उसके लिए अब आम क्या करेंगें ये आंड और उस करेंगें अभी हम सर्फ आंड नहीं काम च़ाइएं बज़ सिमले लिए आब अगर लेक्वाय मेंट है तो और को भी इुँज कर सर्फ हैं तो इस को तो किया इ्रेज और किस फरीखे से मैंने लिखाएए. अगो आब ब आप में अपारेटर वाला भीटीो धिखाओगा अप वीडियो नबर ख़र है, और मही देखाई तो इस भीडियो के देखष्ठन मैं पलेलिसद का लिएगा पलेलिसद अपन करो एक एग वीडियो स्तिक्वेंषलि देखो तागे आपको साई जीज़ जब प्रपरली सवज्गाई यो ने अप्रेटेर बीरिवो देखा होगा लिए में खताया था इस अंद का रूचा, ये इन्ट के लिफ्ट में राप आद वे में हम दो कुँन टोब में चेक गरा form of your operator's video, in which I told you of this end of use. अब ये तू कब होता है जब दोनो कंदिशन प्रू है तो ये अप ये अप कंदिशन कप प्रू होगी जब A से A, B से बड़ा है और A, C से भी बड़ा है तो अगर दोनो कंदिशन प्रू है तो A is max अगर falls है, तो else पर जाएंगे और A को रित लगाएंगे एक चाएक करालेढा है, B greater than A and B greater than C तो अगर B से भी बड़ा है और B C से भी बड़ा है, दोनो कंदिशन तरू है जब if कंदिशन तरू होगे टचाए भी और तो अपन क्या प्रेशोग है, B is max подобनार अर्गते.. औब घुने ईवने कुछ of negativeかなर अ plugs i Good ऻडागे का सीब करनातो मैंगानी के विप आपको सोत न सके। At that Omnims दो चफा Michaels या करे दम टैंग inequality C खेल डोन कर ये तो जो कि थी मोड़रब़े है। �アड़ फाऴ हदुग a तो नैस्टेट तो चोता बनाने के लिए आप ये बाली चीजें अपलाए कर से थीगे, तो आन्द को लिएपीट कर रों, आन्द पभी तू अपाए जब दोनो कंदिशन तू है, और दोनो कंदिशन तू है, आनद कर रिगल तू है तो इप भी तू होँजाएगा, अदर बाइस हमें आल्स में जाना करेएग, छिक, तो ये मैंने एकश्टें किया अगली प्रोबलम को, अब अपने पास दो और प्रुग्राम बच्तें, तो पहले इसको पिक करते है, तो मैं अपने भी चली प्रोपलम दोनो जागा, अपने औब वी, यक वोई आपने आपनी तू है, वे अपने अपना तो मैं, अपने गब लिएगे गब गब पास दा मैंगफाना, यह अप्ले क्रनी भेशिख का यूँँई बढार थु और फिर करनी भेश़ पर अदी वताइ। तो पिले रेईसल दिकालते है शेलिन क्र मैंत gebracht सार प्रैस कोंट क्र क्रीन क्रेईस के रेईस किभराउगर solution तो अप चाहो तो उसको अगली लैंग में भी लिख सकते हो, फिर से करले बिसस लगाए, विसर्ट निकाला, अब रिसर्ट निकालेंगें, cp-sp, तो कि अब लोस होने वाला है, लोस एकवल्स तु वोसल दी र, अप ऐल्स, तो अगर तो अगर फिर्स करले लैंग में नहीं, � अप श्वत चन्चित, बी फूल सुजाती है, सेकंड, भी फूल सुजाती है, तो तर्वड के अज में बारेकली क्णालिख हो गे, भ्रें त्फ, नो लोस नो प्रोटित, तुस्त्री के सीय एह प्रुप्रूँ्ट फ Bliss ॥ौवा। एसको सेव करते है। ॐट्सौज पुश्वर Ю॥ौग। तुवा। तुवा। अप सब कोस प्रईसे हनेद और सेल लिंग प्रूएसे। तुवा। ब्रूइट वोहRep1 कितना वोटगे। रह सู่ सेंावगिलोग, Rs 200 and $ 100 बाहमगिलोग परलोग भी दाखा blir ुगा embed दोंकों potatoes पाते लिजा人ौ finalmente sum वही डिया उ करा� bab विआयक जो आंगोuria ळम कर से साMONवा। कमसे sent अब ये कर्डी बेसेस की भी ज़रवत नहीं है, क्यों कि इप के साथ है कि लाईन है, तो आप देख सकते हो प्रोगान कि लेंद कि लेंद कितने रेदुस होगें। लोस के लिए ग़ा करेंगें, cp-sp, और ये नोलोस नोग्र, तो देखो, 15 लाईन में अपना प्रोगान एजिस गोगें। यों से विसी थरीके से औब प्रोगान की लेंद को रेदुस कर सकते है, तो प próषीष कर हो कि जि छिने थें से क्ते क Carwynम लिए लीन ताएप करनी पडें, जिने ये खंिप शिक्ए कुमके नींगा की लिए लीबल लिए लीबल के लेंगें. अब लास्ट प्रुग्राम बसता है लीएड़ करेक्टर अन चैक वैदर ये अपर केस लोगर केस जिजेट तो सपेशल संबल यहापर आस्काई वेलूस को लूस करेंगे अपने अपने एक वीडियो में आस्काई वेलूस के बारें बता है जोकी लेक्चा नमर सिक्स अब अ� अपने वेलूस केस लोगर केस पजल संबल, जिगेट तो अब यहापर वैदियपल होगा करेक्टर ताईग, आनटर करेक्तर, यूजर एक करेक्टर इंपूड करेगा अपने अपने देटाईग भारे भीडियो में बता आपने परमेद स्पेसौट अपने ब्र आपने भी � अप सीभ है तर की ल्चारोवाग नकचार यूब पच्मी चलनता साज़ने किन्दी कार्टेर भीआग की लिए ईग, तर बफ़द कीचार शादाया देखाज़ पादी चादान, बपच्मी चलना पच्मी आपच्मी दोई, यग गाड़ादा देखाग, उपना जुधन, जी रोज तब वहाँ है। Feeling� complex is appearance. वहनो सब रोग � opener letaly layer. ये सब भ कोल का बात켜 अँं अचरफीरने। अपर के झैटरूए। if there is nothing like that then we went to Ells per city converted to Ellsper. आपके ळतच जा� Wright Meridian is also converted to Elle. इक आर्उट अपड़ी At that, the dam was offered and then left to the Ellsper government. यहाँ प्रेंट कर सकते हैं, लोवर के स्लेट, अगर ये भी फाल्स होता है, तो अब आम चेख करेंगे दिजित के लिए, तो उसका रेंज होता है, 48-57 तो प्रेंट क्या दिजित, और कुछ भी मैख्स नहीं करता, तो फाइनली वो क्या होगा, स्पेषल सिंबल, तो इस तरी रेंज के अक्छनिए अगर अदटिप्ट होगा आगा कि वो किस खेटक्रेंगे लाए करता, तो इस को रन करते है, नहीं गर न रन, करेक्टर लेए कैपिटलेप, दिखो अपपर केष लैटर, चेगे फिर से रन करते है, यिस बर में आप यहाँ अप औलर, तो ये प्रेश अगर नथ्वेद हँप की भगन गatsony خ urgently sir vaj sat. भगन त गफेःता कर से और छ़ुँखन ह� stone k ing al-kots main kapital ay उ कन सापर रोग कम सीख का ड़म शा फरदरind ,ender ko khutstvarthar याए लूई settlement व ह सीखी मैं भीझाотrent याए bio culinary म अपे खैल की लेज़ �्फ़.। मrsini two उन आस्केव याजी कि नमबर फोँजी लिए बासच्तार तो इसको भी आप रहन करें तो यह गप डोपर अगया इसकिव देख। तो जैसे मैं आन्टर किया फ़ीख, तो नहीं बतार ओई दिजिट कि जो नमबर हम ने औगब निंपुट किया गब यह दिजिट अप प्श्टरी के से आप अप अप अस्चय वेल्रे के लेक्टर अचाभे देश पे खाम्यग़, ataskaya welyi tp onusya pe jaada jaana chaata no 6 अगर आप को पता है, तो अप ये समजी रहे ह हुंगे, aap khu pata hai to aap ye samazhi rahe hui khe, और आप थब वीडियो के कमप्लीशन तेबाद आप अप आप अप अगर अगर मुस से अगर क्लासे ज्डताती हो आप खमिकेट करना चातो देने लिए लीए दीटेल सेंगा am only gonna a comment on it so that i will prepare more different kind of videos for you so I hope for you to understand what i have explained you thank you for watching this video