Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sum of array

int sumofarr(int *a, int n) {
	if (n>1)
        return a[n-1]+sumofarr(a, n-1);
    return a[0];
}
Source by www.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #sum #array
ADD COMMENT
Topic
Name
2+1 =