C++ Program to find the sum of the series using friend function

Write a program in C++ to find the sum of the series using friend function.

sum of the series c++