Write a C program and define a function add () that accept three integers in array.
This program defines a function add() that accepts three indices, sums the elements at those positions in the array, and returns the result. `#include // Function to calculate the sum of elements at specified indicesint add(int a[], int i1, int i2, int i3){return a[i1] + a[i2] + a[i3];} int main(){int a[] = {7, 8, 8,…