#include <stdio.h>
float sum(float list[], int n){
float tempsum = 0; int count;
count++;
int i;
printf("count= %d\n", count);
for(i=0;i<n;i++){
// count++;
tempsum += list[i];
// count++;
count += 2;
}
// count++;
// count++;
count += 2;
printf("count= %d\n", count);
return count;
}
int main() {
float alist[] = {1,2,3,4,5};
float result = sum(alist,3);
printf("result= %2.0f", result);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: