 Hello friends, I am Sanjay Gupta. I welcome you on my YouTube channel. You can watch various programming related videos here. It contains more than 800 videos. You can search these videos through the keyword programming by Sanjay Gupta. In this video, I am going to demonstrate you how you can implement ABS function as predefined as well as how you can create its user defined function. So first I am going to tell you how you can use ABS as predefined function. So ABS stands for absolute value. It means if you have negative values and you want to convert them into positive, then you can use ABS function. So first I am going to include header files. So I have included stdi.h. Second I am including mac.h because if you are using ABS as predefined function, then you have to include mac.h header file. Now I am going to define main function. Inside main function, I am declaring a variable n which is of integer type and its value is minus 5. Now I am going to use ABS function. So first I am printing value of n before use of ABS and then after use of ABS. So in line number 7, you can see I have directly printed value of n and at line number 8, I have printed value of n in wrapping it as ABS function. So ABS is a predefined function. So I am directly using it here. Now I am going to execute this code. So you can see the output before ABS equals to minus 5 and after ABS equals to 5. So this way, I hope you have understood how we can use predefined ABS function. Now I am going to convert it into user defined function. Before that, notice that if I declare it as float, then I have to use the function f ABS. It means for integer function is ABS and for float function is f ABS. So if you are using float variables, then you can use f ABS function to convert negative value into positive. Again, I am going to execute this code. You can see the output before ABS minus 5.5 and after ABS, it is printing 5.5. So this way, you can convert negative values into positive with the help of ABS function. So these were predefined implementations. Now I am going to declare a user defined function. I am naming it as absolute. It's return type is int. It's argument type is int. So this is implementation of main function. Here you can see I have declared two variables. First is n whose value is minus 5. Second is r. Then n is printed that is before absolute. Then I am calling absolute function passing n. The returned value will be stored inside r. Then I am going to print after absolute value of r. After this main function definition, I am going to define absolute function definition. And here I am going to return value of n and I am placing minus sign before it. So if n is containing negative value and I am placing minus sign before it, then that negative value will be converted into positive automatically because minus into minus equals to plus. So this way I have implemented this user defined function definition for absolute value generation. Sorry, I have not converted these format specifiers as percentage because here I am using integer data type. Again I am going to execute this code. This time you can see outputs are correct. Before absolute it is minus 5. After absolute it is 5. So this way a program is working properly. If you want to convert it into float, then you can replace all int data types as float and this percentage will be replaced as %f. So this way I have implemented both the implementations of abs. I have demonstrated it as predefined function implementation and as well as with user defined function implementation. I hope you have understood whatever I have explained in this video. If you want to watch more programming related videos, you can follow my youtube channel. Thank you for watching this video.