Code:
double function(double, double, double);
int
main (int argc, char **argv){
setvbuf(stdout, NULL, _IONBF, 0);
double a,b,c;
int n=0;
while(scanf("%lf %lf %lf", &a, &b, &c)==3){
printf("%.1f , %.1f ,%.2f \n", a,b,c);
function(a,b,c);
n++;
}
printf("%.1f \n", 3*(function(a,b,c)));
printf("Number of loops: %d",n);
return 0;
}
double
function(double a, double b, double c){
float d, e, f, g;
d=sqrt((a*a)+(b*b));
e=(2+c)*PI*x*;
f=pow(3,(e/3));
g+=f;
return g;
}
so here is my function. my problem is that whne i run it, it doesnt actually add up all the f to the g-as in g+=f has no effect at all. it only takes the lsat input to acccount. i dont know how to change this
also, can u please start me off with how to add the arrays and also so that reads in data...
sorry for not putting this in on post. i thought i would name it by wat my problem was.