Find the sum of series 0. X + 0. XX + 0. XXX + ... upto k terms | function which return the sum of series ; Driver code
function sumOfSeries ( x , k ) { var y = ( ( ( x ) / 81 ) * ( 9 * k - 1 + Math . pow ( 10 , ( - 1 ) * k ) ) ) ; return y ; } var x = 9 ; var k = 20 ; document . write ( sumOfSeries ( x , k ) ) ;