#include <stdio.h>
Go to the source code of this file.
|
| #define | PI2 2*3.1415926535897932 |
|
| int | main (int argc, char *argv[]) |
◆ PI2
| #define PI2 2*3.1415926535897932 |
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 5 of file 011_seno.c.
6{
8 int n, i;
9 printf("Ingrese el valor de x: ");
10 scanf("%f", &x);
12 do{
13 printf("Ingrese el numero de terminos: ");
14 scanf("%d", &n);
15 }while(n<1);
16 for(i=0, sx=0,
fct=x; i<n; i++)
17 {
18 sx += (1-2*(i%2))*
fct;
19 fct *= (x/(2*i+2))*(x/(2*i+3));
20 }
21 printf("sin(%f) = %f\n", x, sx);
22 return 0;
23}
double fct(double x, int n)