C Programming Code Examples C > Functions Code Examples program to find sum of array elements using recursion program to find sum of array elements using recursion Write a C program to find sum of array elements using recursion. How to find sum of array elements using recursive function in C programming. #include <stdio.h> #define maxsize 100 /* Function declaration to find sum of array */ int sum(int arr[], int start, int len); int main() { int arr[maxsize]; int N, x, sumofarray; /* Input size and elements in array */ printf("Enter size of the array: "); scanf("%d", &N); printf("Enter elements in the array: "); for(x=0; x<N; x++) { scanf("%d", &arr[x]); } sumofarray = sum(arr, 0, N); printf("Sum of array elements: %d", sumofarray); return 0; } /* Recursively find the sum of elements in an array. */ int sum(int arr[], int start, int len) { /* Recursion base condition */ if(start >= len) return 0; return (arr[start] + sum(arr, start + 1, len)); }