Real World Applications: Summing a Series
Problem
Write a program to sum the first n terms of the infinite series
1/12 + 1/22 + 1/32 + 1/42 + …
We first prompt the user for the value n. We add the terms starting from the smallest. This improves the accuracy of the sum by ensuring that the values to be added are within the same range, so that we minimize the loss of significant digits due to rounding.