 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how to use hash if depth 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 implement a code which will demonstrate you the use of hash if depth directive. So first of all, I am going to include a header file that is stdio.h. Now I am going to define a macro whose name is pi. Its replacement token value is 3.141. Now I am going to define main function where I will be using hash if depth directive. So hash if depth directive is used to check whether a particular macro is already defined or not. So you can use it like this hash if depth and then macro name. So macro pi is already defined using hash define. So here with the help of hash if depth, I am checking whether this pi macro is defined or not. So now I can perform a particular calculation like I want to calculate area of circle. So formalize pi r square. So I am using pi into 5 into 5. So this will be calculated only if pi macro is defined. If this macro is not defined then I can use hash else and with the help of printf, I can print the message pi is not defined. So this message will be displayed on output screen if pi macro is not defined. And to close this if depth block, I have to use hash and if then return 0. So this is the complete code which is checking whether the pi macro is defined or not. So right now it is defined. So this program will show a particular message that is area equals to and some value which is based on pi into 5 into 5. So now I am going to execute this code. You can see the output area equals to 78.525000 is displayed on output screen. So this program is working properly. Now suppose if I remove this macro right now no macro the with name pi is not defined. So there is no macro which is available in this program. So now let's see what happens while I will be executing this code. You can see it is showing pi is not defined. So this time hash else is executing because pi macro is not defined. So friends if you want to use a particular macro then you can check whether it is already defined or not with the help of hash if depth. So this is very useful directive with checks whether the macro is already defined or not. So if it is not defined you can show an error message so that a programmer or user can understand that a particular macro is not available. Otherwise the particular calculation which you want to perform will be evaluated. So this is all about hash if depth directive that I have demonstrated you in this video. I hope you have understood all the concepts well. 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 there. Thank you for watching this video.