Program to print GP ( Geometric Progression ) | function to print GP ; starting number ; Common ratio ; N th term to be find
function printGP ( a , r , n ) { let curr_term ; for ( let i = 0 ; i < n ; i ++ ) { curr_term = a * Math . pow ( r , i ) ; document . write ( curr_term + " " ) ; } } let a = 2 ; let r = 3 ; let n = 5 ; printGP ( a , r , n ) ;