Lagrange's Interpolation

Sample C Program that uses Lagrange's interpolation formulae in mathematics

  1. #include <stdio.h>
  2. #include <math.h>
  3. "\n""*""\n\t Lagrange's Interpolation ""\n\t *************************""\n\t Enter the values of xin[f(x)], n [No. of pairs]:\n");
  4. scanf("%f%d""\t\t xin=%f\t\t n=%d\t\t""\nEnter the x, y values [pairs]\n""%f%f""\n\t\t x[i]\t\t\tf[i]\n""\n\t\t%f\t\t\t%f\n""\n\n\t\t\t sum = %10.4f\n", sum);
  5. line();
  6. }