#include <stdio.h>
#define MAX_SIZE 100
//함수 sum의 prototyp 타입 선언
float sum(float [], int);

float input[MAX_SIZE], answer;

void main(void)
{
    int i;

    for (i = 0; i < MAX_SIZE; i++)
        input[i] = i;

    answer = sum(input, MAX_SIZE);

    printf("The sum is : %f \n", answer);
}

float sum(float list[], int n)
{
    int i;
    float tempsum = 0;

    for (i = 0; i < n; i++)
        tempsum += list[i];

    return tempsum;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: