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

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