 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you the use of defined pre-processor directive for conditional compilation in C programming. Before starting, you can note how you can search my YouTube channel. You can type my name Sanjay Gupta in YouTube. My channel will be available there. You can watch various programming related videos here. Now I am going to demonstrate you how you can use defined pre-processor directive. So first of all, I have included a header file that is stdio.h. Now I have defined a macro whose name is pio and its replacement token list is 3.14. Now inside main function, I am going to use this defined pre-processor. So you can use this like this hash if defined pio. So this defined pre-processor is checking whether pio macro is already defined or not. So if it is defined, then this condition will become true. So here you can write this message value of pio equals to percent f and then pio. If it is false, then you can print a message value of pio is not defined and then hash and f. So this way, with the help of defined pre-processor directive, you can check whether a particular macro is defined or not. You can also perform this operation with the help of hash if def that is demonstrated in my another video. You can watch that video if you want to understand the use of hash if def pre-processor directive. It is similar to that. So now I am going to execute this code so that you can understand whether it is working properly or not. So you can see it is showing correct results. Value of pio equals to 3.14000. Now if I remove this macro from here, right now pio macro is not defined. So again, I have to execute this code so that we can see the results. So I have executed this code. You can see the output. This time it is showing else part that is value of pio is not defined. So it is checking whether the pio macro is defined or not. So right now it is not defined. That's why it is printing else part of this program. So this way, with the help of this defined operator, sorry, with this defined pre-processor directive, you can check whether a particular macro is defined or not. Now you can use it in another way like hash if not defined pio. So if pio is not defined, so you can write hash defined pio, then it's replacement value that is 3.14. So if pio is not defined, then this hash defined will define this pio and then printf will be printing this message on output screen. So this time I am removing this hash else part because that is not required now. Again, I am going to execute this code. So you can see the output. This time macro is not defined above main. And after checking that macro is defined or not, if the condition is true, then I have defined the macro. So you can use this defined pre-processor in negative way also, like I have demonstrated you in this demonstration. So I hope you have understood both the demonstration well how we can use defined pre-processor directive for conditional compilation in C programming. If you want to watch more programming related videos, you can search my name Sanjay Gupta in YouTube. My channel will be available there. You can watch various programming related videos here. You can also download my programming app Techimus which is available on Google Play. Thank you for watching this video.