Als ik volgend programma probeer te compileren dan krijg ik de melding: "gcc: cannot specify -o with -c or -S with muliple files"
Wat is er fout?
Ik gebruik anjuta om C te programmeren
#include
#include
int faculteit(int n)
{
int i, fac;
fac=1;
for (i=2; i<=n; i++)
fac*=i;
return(fac);
}
double reeks_ontwikkeling(double x, int max_n)
{
int n;
double reeks=0.0;
for (n=0; n reeks+=pow(x,n)/faculteit(n);
return(reeks);
}
int main(void)
{
int max_n=10;
double x, exponent, reeks;
double step=0.1;
for(x=0.1; x<=1.0; x+=step)
{
exponent=exp(x);
reeks=reeks_ontwikkeling(x, max_n);
printf("\nx=%6.2lf reeks=%12.4lf exponent=%12.4lf verschil=%lf",
x, reeks, exponent, exponent-reeks);
}
return(0);
}