Underc0de

Programación General => C / C++ => Mensaje iniciado por: DtxdF en Diciembre 11, 2019, 12:28:50 PM

Título: Calcular el número E
Publicado por: DtxdF en Diciembre 11, 2019, 12:28:50 PM
¡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

#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