Write a program in C++ to find the sum of the series by using the constructor and destructor

Write a program in C++ to find the sum of the series by using the constructor and destructor.

sum of the series in C++

Output

sum of the series in C++