Răspuns:
Explicație:
#include <iostream>
using namespace std;
int k;
float x,y, p,t=1;
int fact(int m)
{
int f=1;
for (int j=1; j<=m; ++j)
f=f*j;
return f;
}
int main()
{
cout << "x="; cin >> x;
p=x*x; t=x;
for (int i=0; i<=3; i++)
{
if (i%2==0)
y=y+t/fact(2*i+1);
else y=y-t/fact(2*i+1);
t=t*p;
}
cout << "y=cos(" << x << ")= " << y;
}