You are viewing a single comment's thread. Return to all comments →
int simpleArraySum(int n, int* ar) { int sum=0; for(int i=0;i
int main() { int n; scanf("%d", &n); int *ar = malloc(sizeof(int) * n); for(int ar_i = 0; ar_i < n; ar_i++){ scanf("%d",&ar[ar_i]); } int result = simpleArraySum( n, ar); printf("%d\n", result); return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Array Sum
You are viewing a single comment's thread. Return to all comments →
int simpleArraySum(int n, int* ar) { int sum=0; for(int i=0;i
int main() { int n; scanf("%d", &n); int *ar = malloc(sizeof(int) * n); for(int ar_i = 0; ar_i < n; ar_i++){ scanf("%d",&ar[ar_i]); } int result = simpleArraySum( n, ar); printf("%d\n", result); return 0; }