#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 010_lnx.c.
4{
5 float lnx, x, num,
fct, px;
6 int i, den, n;
7 do{
8 printf("Intese el valor de x: ");
9 scanf("%f", &x);
10 }while(x<=0);
11 do{
12 printf("Ingrese el numero de terminos: ");
13 scanf("%d", &n);
14 }while(n<=0);
15 for(i=0, px=(x-1)/(x+1),
fct=px, lnx=0; i<n; i++)
16 {
18 fct*= (2*i+1)*(px*px)/(2*i+3);
19
20 }
21 lnx*=2;
22 printf("ln(%f) = %f\n", x, lnx);
23 return 0;
24}
double fct(double x, int n)