Sunday, August 2, 2009

Write a program in c using functions to implement sine series?

Did you mean this?:





#include %26lt;math.h%26gt;


#include %26lt;stdio.h%26gt;





int main()


{


int step = 8;


float step_size = 2.0*M_PI/step, x;


for (x = -1.0*M_PI; x %26lt;= M_PI; x += step_size)


printf("%2.3f\t%2.3f\n", x, sin(x));


return 0;


}

floral design

No comments:

Post a Comment