Can someone solve expansion of sine function in c language? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can someone solve expansion of sine function in c language?

1st Aug 2019, 4:31 PM
Jayneel Jariwala
Jayneel Jariwala - avatar
2 Answers
+ 2
What did you try ?
19th Jan 2020, 11:28 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 1
sin(x) = x - (x^3)/ 3! + (x^5)/ 5! - .... Make a loop that increments n from 1 to the number of terms that you want to calculate. In every iteration sum up: (-1)^(n-1) * (x ^(2 n +1) / ((2n+1)!) To a variable. After the loop this variable will have the value of sin(x)
19th Jan 2020, 12:36 PM
unChabon
unChabon - avatar