i have to calculate pi by using the infinite series:
pi = 4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 ....
the program is suppose to read in a positive integer and prints a table showing the values of pi approximated by each term. my output is this when i enter 5:
1:4
2:3
3:4
4:4
5:4
which i know is wrong. i have tried so many things to fix it but nothing has helped. i know it is probably something so simple, but i cant seem to find the error. can any one tell me where my error is and how to fix it? thanks in advanced.
thanks Bazzy, that fixed everything. i knew it was truncating, but i havent programmed in 4 months so i couldnt remember how to fix it and i tried everything and was getting frustrated.