/* e_calc.c * computes e to a user specified degree of precision * * King Chapter 6, Ex. 11. * The number e may be expressed as an infinite series * 1 + 1/1 + 1/(2!) + 1/(3!) + 1/(4!)... * * By Cory Spitzer * March 23th, 2013 * * */ #include int main(void){ float modifier; float divisor = 1, e = 1; int number, index, sub_index; // char mod_string; printf("Enter an integer to compute e\n "); printf("higher numbers produce more precision: "); scanf("%i", &number); for (index = 1; index <= number; index++){ for (sub_index = index; sub_index <= number; sub_index++){ divisor = divisor....; } modifier = 1/divisor; // sprintf(mod_string,"1/%d", ) printf("The modifier for the round %d is 1/%f\n", index, divisor); e += modifier; printf("e = %f\n", e); } printf("e = %f\n", e); return 0; }