Find the sum of the series 1 + 11 + 111 + 1111 + ... . . upto n terms | C # program to find the sum of the series 1 + 11 + 111 + 1111 + ... . ; Function for finding summation ; Driver Code
using System ; class GFG { static int summation ( int n ) { int sum ; sum = ( int ) ( Math . Pow ( 10 , n + 1 ) - 10 - ( 9 * n ) ) / 81 ; return sum ; } public static void Main ( ) { int n = 5 ; Console . WriteLine ( summation ( n ) ) ; } }