Program for N | JavaScript Program to find nth term of Arithmetic progression ; using formula to find the Nth term t ( n ) = a ( 1 ) + ( n - 1 ) * d ; starting number ; Common difference ; N th term to be find ; Display the output
function Nth_of_AP ( a , d , N ) { return ( a + ( N - 1 ) * d ) ; } let a = 2 ; let d = 1 ; let N = 5 ; document . write ( " " + N + " " + Nth_of_AP ( a , d , N ) ) ;