The Student Room Group

writing a formula

How do we allow a program to calculate the the sin of a number input by the user using the formula-- sin(x) = x - X^3/3! + x^5/5! - x^7/7! + x^9/9! ..... to the number of terms also input by the user.

supposing that the number of terms to which sin(x) has to be calculated is n then how do we write the above formula in our program to do so.
do we use loops in here ?
Reply 1
shouldnt you specify what programming language first?
yea you have to use a loop so that it can calculate each term up to the nth term.

Latest

Trending

Trending