Run the sum program
Compile with
cc pg136.c
a.out
Again (1 = yes, 0 = no)? 1
n = ? 10
Sum = 1.549768
Again (1 = yes, 0 = no)? 1
n = ? 1000
Sum = 1.643934
Again (1 = yes, 0 = no)? 1
n = ? 100000
Sum = 1.644924
Again (1 = yes, 0 = no)? 1
n = ? 1000000
Sum = 1.644933
Again (1 = yes, 0 = no)? 0
Expected answer for the infinite series is ?2/6=1.644934067
Previous slide
Next slide
Back to first slide
View graphic version