Program to find sum of given series in C++