Discover a world of knowledge at Westonci.ca, where experts and enthusiasts come together to answer your questions. Get the answers you need quickly and accurately from a dedicated community of experts on our Q&A platform. Discover in-depth answers to your questions from a wide network of professionals on our user-friendly Q&A platform.

How do you accumulate a value in a loop? Assume these two variables have been declared before the loop.

double input =0.0; double sum =0.0;

a. sum += input;
b. sum=input;
c. input = input + sum;
d. sum = sum + input;