<prompt> Write a C program to calculate the sum of all elements in a given array.array 2, 4, 3, 7, 5  <response>: Here is a C program that takes an array as input and calculates the sum of all of its elements:include int main int array 2, 4, 3, 7, 5; int i, sum 0; int n sizeofarraysizeofarray0; for i 0; i n; i sum arrayi; printfSum of all array elements dn, sum; return 0;In the above program, we first declare an array with 5 elements 2,4,3,7,5. We also declare two integer variables i and sum. The variable i is used as a counter in the for loop and sum is used to store the final result of the sum of all array elements. To calculate the number of elements in the array, we divide the size of the entire array by the size of one element using the sizeof function. The for loop is used to iterate over each element of the array and add its value to the sum variable. Finally, we print the value of sum which gives us the sum of all elements in the array. 