fallo persiste..
#include <iostream>
#include <cmath>
#define PI 3.141592654
using namespace std;
int main()
{
int x,n,b,fact,fac,i,num;
cout << "Ingrese el numero de terminos a aproximar: " << endl;
cin >> n;
cout << "Ingrese el valor de angulo: " << endl;
cin >> x;
{
int num;
if (n%2==0)
num=1;
else
num=-1;
}
float rad;
rad = (x*PI)/180;
{
int fac=1;
fact=2*n+1;
for (b=1 ; b<=fact ; b++)
fac=b*fac;
}
double sen = 0;
for (i=0; i<=n; i++)
{
sen=sen+(num*pow(rad,fact)/fac);
}
cout << "seno " << x << ": " << sen << endl;
system("pause");
return 0;
}
#include <iostream>
#include <cmath>
#define PI 3.141592654
using namespace std;
int main()
{
int x,n,b,fact,fac,i,num;
cout << "Ingrese el numero de terminos a aproximar: " << endl;
cin >> n;
cout << "Ingrese el valor de angulo: " << endl;
cin >> x;
{
int num;
if (n%2==0)
num=1;
else
num=-1;
}
float rad;
rad = (x*PI)/180;
{
int fac=1;
fact=2*n+1;
for (b=1 ; b<=fact ; b++)
fac=b*fac;
}
double sen = 0;
for (i=0; i<=n; i++)
{
sen=sen+(num*pow(rad,fact)/fac);
}
cout << "seno " << x << ": " << sen << endl;
system("pause");
return 0;
}