 Hello friends. I am Sanjay Gupta. In this video, I am going to demonstrate you the use of hash error pre-processor directive 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 error pre-processor directive. First of all, I am going to include a header file that is a stdio.h. Now I am going to define main function. Inside main, I am using a pre-processor directive that is hash if def, which checks whether a particular macro is defined or not. So the macro PI is not defined and I am checking hash if def PI. So if it is defined, then this condition will become true. So I am going to print the value of PI if this condition is true. Otherwise hash else will be executed. Here I am going to use hash error pre-processor directive, which will display the message value of PI is not defined and then hash and def. So this way I have used hash error pre-processor directive at line number 8. So this time the line number 5 condition will be false because PI macro is not defined. So control will be transferred to line number 7, that is hash else. At line number 7, line number 8 is defined. That is hash error. So this hash error will show this message value of PI is not defined in form of compilation error. So while I will be compiling this code, this value of PI is not defined. This arrow will be shown in compilation log. So right now I am going to compile this code. You can see the compilation results. Here you are seeing an error message that is hash error value of PI is not defined. So if you want to show a compilation error with a particular message, then you can prefer hash error pre-processor directive in the program. Otherwise you have to use printf that will display the output on output screen. So whenever you want to show an error message at the time of compilation, then only you can prefer hash error pre-processor directive. Now if you want to ignore this error, you have to define this macro that is PI. So now I have defined this macro. Let's see what happens now. I am again compiling this code. You can see it is showing no errors and no warnings. It means it is now compiled successfully. Now I can execute this code. You can see the output. It is showing value of PI equals to 3.14. So this way you can use hash error pre-processor directive in your program whenever you want to show a particular message as compilation error. I hope you have understood how we can prefer this hash error pre-processor directive in our code. If you want to watch more programming related videos, you can watch my name Sanjay Bhukta in YouTube. My channel will be available there. You can also download my programming app that is TechMS which is available on Google Play. Thank you for watching this video.