当前位置:网站首页>C language, input a positive integer n, calculate the following formula to get the value of E

C language, input a positive integer n, calculate the following formula to get the value of E

2020-12-07 22:48:06 Don't be late for class

#include <stdio.h>
void main()
{
int n;double k=1,s=1;
for(n=1;1/k>=1e-6;n++)
{k=k*n;s+=1/k;}
printf("e=%.5f",s);
}

版权声明
本文为[Don't be late for class]所创,转载请带上原文链接,感谢
https://chowdera.com/2020/12/20201207224719829k.html