Thanks for taking the trouble...
Thanks for taking the trouble...
Last edited by galaxy; 05-01-2003 at 05:30 AM.
You have several syntax errors, like you never declare i or have misplaced parantheses. Did your computer crash for that? lol!
And use code tags next time. It is easier to spot errors with a nice indentation.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
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++)