Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

sum of list in C

#include <stdio.h>

void main() {
	int List[5] = { 1, 2, 3, 4, 5 };
	int sum = 0;
	for (int i = 0; i < 5; i++) {
		sum += List[i];
	}
	printf("%d", sum);
}
 
PREVIOUS NEXT
Tagged: #sum #list #C
ADD COMMENT
Topic
Name
3+5 =