Why does one method of adding all the elements of an array fail when similar methods succeed
Advertisements I have an array of doubles. To simplify the example, I use an array of length 3. I want to add all 3 elements of the array. I do it in 3 ways. Here’s the program to demonstrate. #include <stdio.h> int main() { double a[3] = {1.,3.,5.}; double sum1 = a[0]+a[1]+a[2]; int i=0; double… Read More Why does one method of adding all the elements of an array fail when similar methods succeed