text: Counts paths from a point to reach Origin | C # program for above approach ; Function to find binomial Coefficient ; Constructing Pascal 's Triangle ; Driver code
code: using System ; class GFG { static int binomialCoeff ( int n , int k ) { int [ ] C = new int [ k + 1 ] ; C [ 0 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ) { for ( int j = Math . Min ( i , k ) ; j > 0 ; j -- ) C [ j ] = C [ j ] + C [ j - 1 ] ; } return C [ k ] ; } static void Main ( ) { int n = 3 , m = 2 ; Console . WriteLine ( " Number ▁ of ▁ Paths : ▁ " + binomialCoeff ( n + m , n ) ) ; } }