#include <iostream.h>
#include <conio.h>
double poly (double, double, double = 0, double = 0, double = 0 );
void main( )
{
double x = 2.0003 ;
cout<<" poly(x,7) = " << poly(x,7) << endl;
cout<<" poly(x,7,6) = " << poly(x,7,6) << endl;
cout<<" poly(x,7,6,5) = " << poly(x,7,6,5) << endl;
cout<<" poly(x,7,6,5,4) = " << poly(x,7,6,5,4) << endl;
}
double poly (double x, double a0, double a1, double a2, double a3 )
{
return a0 +(a1 + (a2 + a3 *x)*x)*x;
}
0 comments:
Post a Comment