ProgIng - Programación en Ingeniería
Loading...
Searching...
No Matches
009_exp_3.c
Go to the documentation of this file.
1
#include <stdio.h>
2
3
int
main
(
int
argc,
char
*argv[])
4
{
5
float
ex, x,
fct
;
6
long
int
i, 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,
fct
=1; i<n; i++)
14
{
15
ex +=
fct
;
16
fct
*= x/(i+1);
17
}
18
printf(
"exp(%f) = %f\n"
, x, ex);
19
return
0;
20
}
fct
double fct(double x, int n)
Definition
Ejemplo029.c:34
main
int main(void)
Definition
Ejemplo_035.c:15
src
20251
009_exp_3.c
Generated by
1.16.1