#include #include #include void main() { double x[4]={3,1,5,6}; double f[4]={1,-3,2,4}; double first[3],second[2],third; int i; for(i=0;i<3;i++)first[i]=(f[i]-f[i+1])/(x[i]-x[i+1]);// first divided difference for(i=0;i<2;i++)second[i]=(first[i]-first[i+1])/(x[i]-x[i+2]);// second divided difference third=(second[1]-second[0])/(x[0]-x[3]);// third divided difference double xx; cout<<"Please input interpolation location x : "; cin>>xx; double ff=f[0]+(xx-x[0])*first[0] +(xx-x[0])*(xx-x[1])*second[0] +(xx-x[0])*(xx-x[1])*(xx-x[2])*third; cout<