Exemple #1
0
int main(void)
{
    int i = 0, sum = 0;
    int array[DIM] = { 1, 2, 3 };
    SUMARRAY(array, DIM);
    printf("Sum: %d\n", sum);
    return 0;
}
Exemple #2
0
int main() {
  int i;
  int sum = 0;
  int ary[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  int size = sizeof(ary) / sizeof(int);
  
  for(i = 1; i < 11; ++i)
    printf("Raggio %d: %f\n", i, CALC(i));
  printf("\n");
  
  printf("Values: ");
  for(i = 0; i < size; ++i)
    printf("%d ", ary[i]);
  printf("\n");
    
  SUMARRAY(ary, size);
  printf("Sum of the %d elements: %d\n", size, sum);
    
  return 0;
}