okay, thanks swoopy...
i changed the 1 to n as you suggested, and you're right, i don't want int arithmetic... would you specify double by...
(double)*pi_value += (4.0/((n*2)-1));
?
Type: Posts; User: wallysworld
okay, thanks swoopy...
i changed the 1 to n as you suggested, and you're right, i don't want int arithmetic... would you specify double by...
(double)*pi_value += (4.0/((n*2)-1));
?
sorry, i wasn't clear, i meant i edited it in my previous post, but here it is again
#include<stdio.h>
void pi(int n, double *pi_value, int *iterations); //declare function
int main...
sorry salem, the "glaring" syntax errors were typos when i was typing that in, glance at it again if you don't mind and see if you catch anything now, i also edited the values of iterations and...
so here is what i've come up with...
it seems to me like it should execute correctly, but somewhere something is causing my output to be bogus large numbers; however, it will compile... does anyone...
"N" is the value of the denominator that i'm continuing to, its input by the user.
i think i've got the for loop now, i guess the only think i'm still confused on is exactly how to incorporate...
hi,
i'm currently working on a program which asks the user to input an integer value of "n" to determine the number of iterations of the denominator in the equation for PI listed below.
I have...