You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
296 B
11 lines
296 B
7 months ago
|
// This is a simple loop that sums elements of an input array and
|
||
|
// returns the result. It's here mainly because it's one of the
|
||
|
// simple examples guiding the early Subzero design.
|
||
|
|
||
|
int simple_loop(int *a, int n) {
|
||
|
int sum = 0;
|
||
|
for (int i = 0; i < n; ++i)
|
||
|
sum += a[i];
|
||
|
return sum;
|
||
|
}
|