<prompt> int arr 5.10, 2.21, 12.99, 9.1; int n 4;Kujenga kazi ambayo inachukua safu na urefu wake kama hoja, na anarudi jumla ya mambo ya safu.  <response>: Here is a function that takes an array and its length as arguments, and returns the sum of the arrays elements:cfloat sumArrayfloat arr, int n float sum 0; forint i 0; i n; i sum arri; return sum;To use this function with the given input, you can call it as follows:cfloat arr 5.10, 2.21, 12.99, 9.1; int n 4;float result sumArrayarr, n; 