/* Write a C program that estimates the value of the mathematical constant e by using the formula: e = 1 + 1/1! + 1/2! + 1/3! + …... */ #include main() { int n,i,f=1,j; float e = 1.0; clrscr(); start: printf("Enter n value: "); scanf("%d",&n); if(n<0) { printf("Please enter non-negetive value\n"); goto start; } for(i = 1;i<=n;i++) { for(j = 1;j<=i;j++) { f = f*j; } e=e+((float)1/f); f=1; } printf("Result is: %f\n",(float)e); getche(); }