#include <stdio.h>
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 3 of file Ejemplo006.c.
4{
5 int n, i, den;
6 float x, ex, num;
7 printf("Ingrese el valor de x: ");
8 scanf("%f", &x);
9 do{
10 printf("Ingrese el numero de terminos: ");
11 scanf("%d", &n);
12 }while(n<1);
13 for(i=0, ex=0, num=1, den=1; i<n; i++)
14 {
15 ex+=(num/den);
16 num*=x;
17 den*=(i+1);
18 }
19 printf("exp(%f) = %f\n", x, ex);
20 return 0;
21}