ProgIng - Programación en Ingeniería
Loading...
Searching...
No Matches
008_exp_2.c File Reference
#include <stdio.h>
Include dependency graph for 008_exp_2.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 008_exp_2.c.

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