Program for N | PHP 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
< ? php function Nth_of_AP ( $ a , $ d , $ N ) { return ( $ a + ( $ N - 1 ) * $ d ) ; } $ a = 2 ; $ d = 1 ; $ N = 5 ; echo ( " The ▁ " . $ N . " th ▁ term ▁ of ▁ the ▁ series ▁ is ▁ : ▁ " . Nth_of_AP ( $ a , $ d , $ N ) ) ; ? >