ProgIng - Programación en Ingeniería
Loading...
Searching...
No Matches
Ejemplo010.c File Reference
#include <stdio.h>
Include dependency graph for Ejemplo010.c:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 3 of file Ejemplo010.c.

4{
5 int i, n, s;
6 float x, sx, fct;
7 do{
8 printf("Ingrese el numero de terminos: ");
9 scanf("%d", &n);
10 }while(n<1);
11 printf("Ingrese el valor de x: ");
12 scanf("%f", &x);
13 for(i=0, fct=x, sx=0; i<n; i++)
14 {
15 s = 1-2*(i%2);
16 sx += (s*fct);
17 fct *= (x/(2*i+2))*(x/(2*i+3));
18 }
19 printf("sin(%f) = %f\n", x, sx);
20 return 0;
21}
double fct(double x, int n)
Definition Ejemplo029.c:34
Here is the call graph for this function: