Hello, and happy new year first of all.
What I am trying to do is make a program that according to the values the user inputs then displays a polynomial.
The forumla for the polynomial is this:
float par(float x) //H timh ths synarthshs sto shmeio Xo
{
float tel=trap[0][1], timx=1;
int i;
for(i=0;i<n-1;i++)
{
timx=timx*(x-trap[i][0]);
tel=tel+trap[0][i+2]*timx;
}
return tel;
}
Where then the user is asked to input a value for x and then the result of the polynomial is calculated. It all works fine- the result is correct and all- but I can't seem to get the program to display the polynomial before the result is calculated.
It should be like this:
f(x0)+f[x0,x1](x-x0)+f[x0,x1,x2](x-x0)(x-x1)...+f[x0,...,xn](x-x0)...(x-xn)
where f[...]=trap[j]
Thanks for the help people.