Program to print the sum of the given nth term | CPP program to illustrate ... Summation of series ; function to calculate sum of series ; Sum of n terms is n ^ 2 ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int summingSeries ( long n ) { return pow ( n , 2 ) ; } int main ( ) { int n = 100 ; cout << " The ▁ sum ▁ of ▁ n ▁ term ▁ is : ▁ " << summingSeries ( n ) << endl ; return 0 ; }