Calcular el número E

Iniciado por DtxdF, Diciembre 11, 2019, 12:28:50 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

¡Hola!. Estoy un poco aburrido y busqué la formula para calcular el número "E"; sí quieren ejecuten y compren algunas cotufas mientras miran cómo se genera  :D

Código: c
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <unistd.h>

int main(void) {

long double n=1;

while (1) {

printf("\033[2J\033[1f");
printf("e: %.52f", pow(1+1/n, n));
fflush(stdout);

n += 1.0;

sleep(0.1);

}

return EXIT_SUCCESS;

}


~ DtxdF
PGP :: <D82F366940155CB043147178C4E075FC4403BDDC>

~ DtxdF