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