Initializing u and sum
double sum = y [ n - 1 , 0 ] ; double u = ( value - x [ n - 1 ] ) / ( x [ 1 ] - x [ 0 ] ) ; for ( int i = 1 ; i < n ; i ++ ) { sum = sum + ( u_cal ( u , i ) * y [ n - 1 , i ] ) / fact ( i ) ; } Console . WriteLine ( " STRNEWLINE ▁ Value ▁ at ▁ " + value + " ▁ is ▁ " + Math . Round ( sum , 4 ) ) ; } }