Total number of non | PHP program to count non - decreasing numner with n digits ; Compute value of N * ( N + 1 ) / 2 * ( N + 2 ) / 3 * ... ... . * ( N + n - 1 ) / n ; Driver Code
< ? php function countNonDecreasing ( $ n ) { $ N = 10 ; $ count = 1 ; for ( $ i = 1 ; $ i <= $ n ; $ i ++ ) { $ count *= ( $ N + $ i - 1 ) ; $ count /= $ i ; } return $ count ; } $ n = 3 ; echo countNonDecreasing ( $ n ) ; ? >