array_sum
| array_sum | |
|---|---|
| Turn-in directory | 03_array_sum/ |
| Files to turn in | array_sum.c |
| Allowed external functions | None |
| Type of work | Function |
- Write a program which displays the lowercase alphabet on standard output, followed by a newline.
- To help you get started, we will provide some code for you to copy/paste/edit. Make sure you understand every line before you hand it in!
- You need to write a function that takes an array of 15 integers as a parameter and returns the sum of all the elements in the array.
#include <stdio.h> int array_sum(int array[15]); int main() { int array[15] = {3,23,-3,14,7,66,71,8,9,10,131,2,1,1,5}; int result = array_sum(array); printf("%d\n", result); return (0); }
Example output:
$ ./a.out
120$