Sum of the series 5 + 55 + 555 + . . up to n terms | C ++ program for sum of the series 5 + 55 + 555. . ... n ; function which return the the sum of series ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int sumOfSeries ( int n ) { return 0.6172 * ( pow ( 10 , n ) - 1 ) - 0.55 * n ; } int main ( ) { int n = 2 ; cout << sumOfSeries ( n ) ; return 0 ; }