Multiplication with a power of 2 | Returns 2 raised to power n ; Driver Code
< ? php function power2 ( $ n ) { if ( $ n == 0 ) return 1 ; if ( $ n == 1 ) return 2 ; return power2 ( $ n / 2 ) * power2 ( $ n / 2 ) ; } function multiply ( $ x , $ n ) { return $ x * power2 ( $ n ) ; } $ x = 70 ; $ n = 2 ; echo multiply ( $ x , $ n ) ; ? >