 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can implement float array using dynamic memory allocation. Before starting, you can note how you can search my YouTube channel. You can type my name Sanjay Gupta in YouTube search bar. My channel will be available there. You can open it here. Various programming related videos are available. Don't forget to subscribe my YouTube channel. Now I am going to implement solution of this problem. So first I am including a header file that is stdli.h. Another header file stdlib.h. Now I am defining main function. Inside main, I am declaring a variable n, then float pointer p, variable i. Now with the help of printf, I am going to display the message enter size. To receive this size, scanf is written here, which will store the entered value inside n variable. So n will be receiving size of array. Now I have to perform dynamic memory allocation. So for that purpose, I am writing this statement. I am calling malloc function. So with this statement dynamic memory for float array will be allocated. So here n is multiplied with size of float and the returned address will be typecasted into float pointer and beginning address will be stored inside p pointer. Now I can read elements from user. So for that purpose, the message enter elements will be displayed on console. To read elements, I am applying for loop, which will repeat n times. Inside this loop, I am writing scanf statement, which will read float values and these values will be stored in p plus i. So p is having base address. I will be added every time in this p pointer. So different different locations address will be available through this p plus i and the entered value will be stored at those locations. Now after reading operation, I can print the entered values on console. So first this message will be displayed. Now again, I am applying a loop, which will repeat n times. Inside this loop, I have to write printf statement, which will display values on console. So for that purpose, I am using this statement. This time you can see I have used asterisk sign. So p plus i will denote an address and asterisk will be providing value at that address. So this way, all the elements which are available on a particular address will be displayed on output screen. After this, I can call free function, which can deallocate the dynamic allocated memory and then return zero. So this way I have implemented float array with the help of dynamic memory allocation. Now I am going to execute this code. So it is asking size. I have to enter five elements. So I'm entering 1.1, 1.2, 1.3, 1.4, 1.5. You can see the result. I have entered 1.1, 1.2, 1.3, 1.4 and 1.5. And after point, decimal point, six precision values are displayed automatically because percent f automatically display six digits. If you want to reduce these digits, you can apply percent point two F. So in this case, after decimal point two digits will be displayed. So we can see this now. Again, I am entering values. You can see the output this time after decimal point two digits are displayed. So this way I have implemented float array in front of you with the help of dynamic memory allocation. I hope you have understood how we can create dynamic array for float elements in C programming. You can watch more programming related videos. You can search my YouTube channel by my name Sanjay Gupta in YouTube. So watch these programming related videos if you want to improve your programming skills. Thank you for watching this video.