Ein Problem. Helf besuched
-
Was ist los?
#include <stdio.h>
#include <math.h>double root(a, b, c, x0){
int i;
double fx, xk;
for (i=0;i<50;i++){fx = ((a*x0*x0)+(b*x0)+c);
xk = x0 - ((fx/((2*a*x0)+b)));
x0=xk;
}return (x0);
}
int main(){double a, b, c, x0;
printf("Please enter coefficient of x^2\n");
scanf("%f",&a);
printf("Please enter coefficient of x\n");
scanf("%f",&b);
printf("Please enter constant\n");
scanf("%f",&c);
printf("Please enter inital value for x\n");
scanf("%f",&x0);printf("%f", root(&a, &b, &c, &x0));
system("PAUSE");
}
-
Ucc.ie schrieb:
Was ist los?
Sag du´s uns.
Übrigens ist das was du da gepostet hast wohl eher C als C++.