C Programming Code Examples C > Beginners Lab Assignments Code Examples Program to calculate sum of array in C programming Program to calculate sum of array in C programming This program should give an insight of how to parse (read) array. We shall use a loop and sum up all values of the array. #include <stdio.h> int main() { int array[10] = {2, 4, 7, 8, 13, 25, 29, 88, 96, 0}; int sum, loop; sum = 0; for(loop = 9; loop >= 0; loop--) { sum = sum + array[loop]; } printf("Sum of array is %d.", sum); return 0; } procedure sum_array(A) Declare sum as integer FOR EACH value in A DO sum = sum + A[n] END FOR Display sum end procedure