1 Attachment(s)
i did not understood to the question. But i did i don't know is this correct or not
Code:
#include <stdio.h>
#include <math.h>
int
factorial (int number)
{
int factorial;
factorial = 1;
for (int i = number; i > 1; i--)
{
factorial *= i;
}
return factorial;
}
int sigma()
{
int sigma = 0;
int n=2;
for(int i=0; i<=100; i++){
sigma += n*i+1;
}
return sigma;
}
float sinus_cal(float x)
{
float sinus;
float u = 0;
int l = sigma();
for(int i=0; i<=100; i++){
// -1^i
u += pow(-1, i);
}
sinus = ((u / factorial(l)) * pow(x,l));
return sinus;
}
int main()
{
printf("%f",sinus_cal(3));
return 0;
}