Untitled
unknown
c_cpp
a year ago
999 B
5
Indexable
//1
#include <stdio.h>
#include <math.h>
int main()
{
float sin = 0, x, S;
int n = 0;
scanf("%f", &x);
while (n <= 10)
{
S = fabs(pow(-1, 2*n) * pow(x,2*n+1) / tgamma(2*n+2));
n = n+1;
sin = sin + S;
}
printf("%f", sin);
}
//2
#include <stdio.h>
#include <math.h>
int main()
{
float cos = 0, x, S;
int n = 0;
scanf("%f",x);
while (n <= 100)
{
S = pow(-1, n) * pow(x, 2*n) / tgamma(2*n+1);
cos = cos + S;
n = n + 1;
}
printf("%f", 1-cos);
}
//3
#include <stdio.h>
#include <math.h>
int main()
{
double Sh = 0, x, S;
int n = 0;
scanf("%lf",x);
while (n <= 100)
{
S = pow(x, 2*n+1) / tgamma(2n+1+1);
Sh = Sh + S;
n = n + 1;
}
printf("%lf", Sh);
}
//4
#include <stdio.h>
#include <math.h>
int main()
{
double ch = 0, x, S;
int n = 0;
scanf("%lf",x);
while (n <= 100)
{
S = pow(x, 2*) / tgamma(2n+1);
ch = ch + S;
n = n + 1;
}
printf("%lf", 1+ch);
}
Editor is loading...
Leave a Comment