Исправить программу на c++
#include
#include
#include
using namespace std;
int main()
{
float xn,
x,
xk,
y,
ylast,
eps,
dx;
int i,
fac = 1,
sign = -1;
printf("programma scheta ryada teilora i vivoda tablici\n");
printf("vvedite xn\n");
cin > > xn;
printf("vvedite xk\n");
cin > > xk;
printf("vvedite dx\n");
cin > > dx;
printf("vvedite eps\n");
cin > > eps;
printf("\n");
printf("| x | y | i |\n");
printf("\n");
for (x = xn; x < = xk; x += dx)
{
for (i = 1; (i == 1 || fabs(y – ylast) > eps) ; i += dx)
{
ylast = y;
fac *= i;
x *= x;
y += (sign * x / fac);
sign = -sign;
}
printf("| %3.3f | %3.5f | %5d |,%lf\n", & x, & y, & i );
}
return 0;
}