 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can use hash, if, and if 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 the use of hash, if, and if directive. So first of all, I am including a header file that is stdio.h. Now I am defining main function. Now inside main, I have to use hash, if, and if directive. So it is a directive which checks whether the macro is defined or not. So it becomes true if macro is not defined. So this way, I have implemented hash, if, and if macro, which is checking whether p i macro, sorry hash, if, and if directive which is checking p i macro is defined or not. So p i is not defined. So it will become true and it will display the printf masses that is p i is not defined. So I am executing this code. You can see it is showing p i is not defined. It is working properly. Now suppose if p i macro is already defined with its replacement value. And here I have to use hash else so that I can print its another part that is p i is defined. So this time p i macro is defined. So hash, if, and if directive is checking for p i macro, it is defined. So else part will be executed this time. You can see p i is defined. So this way through this hash, if, and if directive, we can check whether the macro is not defined or not. So now you might be thinking what is the, you know, this directive. So suppose you forgot to define a particular macro at the beginning of your program and you want to define it in the middle of the program. But you don't remember correctly whether the macro is defined or not. So if you want to define a macro, if it is not defined earlier, then you can use hash, if, and if directive. So hash, if, and if directive will check whether the macro is defined or not. So suppose p i is not defined previously. So here you can define it with a particular replacement value. Now after defining this macro, that is p i, I can use it in printf statement like this. So after checking whether the p i macro is defined or not, if it is not defined, I have defined it. And after defining it, I am using this p i macro in printf statement. So now let's check whether it will be working properly or not. You can see the output. It is working properly. So in the middle of the program, if you want to define a macro, but you want to make sure that it is not defined already, then only you can use hash, if, and if directive. So now I hope you have understood what is the use of hash, if, and if directive. So you can use this directive only and only if a particular macro is not defined earlier so that you can define it later on. And you can use it after defining it in the middle of the program. So now if I want to use this macro again, I can use this printer statement twice. So this time twice a value of p i will be displayed on output screen. So this is the use of hash, if, and if directive for conditional compilation in C programming. I hope you have understood whatever I have demonstrated in this video. If you want to watch more programming related videos, you can search my name in YouTube. That is Sanjay Gupta. My channel will be available there. You can also download my programming app, Techimates, which is available on Google Play. Thank you for watching this video.