Thanks for taking the trouble...
Printable View
Thanks for taking the trouble...
You have several syntax errors, like you never declare i or have misplaced parantheses. Did your computer crash for that? lol! :D
And use code tags next time. It is easier to spot errors with a nice indentation.
Most, if not all of your variables should be floats or doubles:
Code://int i,t,t0,T,num_harmonic,omega,integrand1,integrand2,
int i,t,t0,num_harmonic,a,b;
//T=20;
double val;
double T=20;
t0=5;
num_harmonic=5;
//omega=2*3.14/T;
//integrand1=0;
//integrand2=0;
double omega=2*3.14/T;
double integrand1=0;
double integrand2=0;
//for(i=1;i<num_harmonic+1;i=i++)
To increment i, use:
for(i=1;i<num_harmonic+1;i++)
//for(t=1;t<5;t=t++)
To increment t, use:
for(t=1;t<5;t++)