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 codeforwin.org #
 
PREVIOUS NEXT
Tagged: #sum #array
ADD COMMENT
Topic
Name
8+6 =