 Hello friends, I am Sanjay Gupta. I welcome you on my YouTube channel. You can watch videos programming related videos here. My channel contains more than 800 videos. You can search those videos through the keyword programming by Sanjay Gupta. In this video, I am going to demonstrate you how you can implement SQRT function as predefined and as user defined. So, first I am going to implement its predefined version. So, I am going to include two header files. First one is stdr.h and second one is math.h. So, SQRT is a predefined function and it is declared in math.h. That's why I am including it. Now, I am going to define main function. Here I am going to declare a variable float n and I am assigning 25 into it. And another variable r which will contain the result. Now, I am going to call SQRT function and I am passing n into it. So, SQRT is a predefined function which will calculate square root of n and the result will be stored inside r. Now, I am going to print the result on output screen. Here I have used printf which will print the result with help of this %.2f. So, %.2f means float value will be printed and after decimal point only two digits will be displayed. So, this way this is the predefined version of SQRT function. Now, I am going to execute it. You can see the output. It is showing the result is 5. So, square root of 25 is 5. Now, I am assigning another value like 26 and I am executing it. So, it is showing the result as 5.10. So, this is the predefined implementation of SQRT function. Now, I am going to implement it as user defined. So, for that I have to declare a function. So, I have declared a function whose name is square root. Its return type is float and it will receive an argument of type float. Then, I have called a function which is declared at line number 3, at line number 7. So, square root function is called I am passing n as an argument and the result will be stored inside r. So, first I am going to calculate square root of 25. So, I am assigning n equals to 25. The result which will be returned will be stored inside r variable. So, that will be printed with the help of printf. Now, I am going to define square root function definition initializing a loop with 0.01. Its condition is I into I less than n and this is the increment I equals to I plus 0.01. And I am terminating this for loop here. So, this loop will repeat according to this condition, I into I less than n. When this condition will be false, this loop will be terminated and after that I am going to return value of I. So, returned value of I will be stored inside r and that will be printed on output screen with help of printf. So, this way I have implemented the user defined definition of sqrt function and you can see the result, it is printing 5 on output screen. Now, I am passing 26 as input. I am executing it, you can see the result is 5.10. So, this way I have implemented both the variations of square root function. First one was predefined with help of sqrt and second one is square root with which is implemented as user defined function. So, I hope you have understood both the variations well. If you want to watch more programming related videos, you can follow my YouTube channel. Thank you for watching this video.