Program to print Arithmetic Progression series | JavaScript Program to print an arithmetic progression series ; Printing AP by simply adding d to previous term . ; starting number ; Common difference ; N th term to be find
function printAP ( a , d , n ) { let curr_term ; curr_term = a ; for ( let i = 1 ; i <= n ; i ++ ) { document . write ( curr_term + " " ) ; curr_term = curr_term + d ; } } let a = 2 ; let d = 1 ; let n = 5 ; printAP ( a , d , n ) ;