1) Write a program in C++
sin(x) can be approximately calculated usingthe following formula, where n! is factorial(n) – for example3!=3*2*1 = 6 (the function in previous problem).
The more terms we use in the series, the higher will be accuracyof the calculations. By using infinite terms in the series we willhave the exact value.
Hint 1: For n! simplyuse (copy and paste) the factorialFunc(n)from previous problem.
Hint 2: This problemsis similar to the “pi series†problem in the homework problems. Asimple for loop is needed. Much easier that it looks.
Write a program that gets x and calculatessin(x) using 10, 100, 1000 and 10,000 terms.
Then run the program and calculate and display the result forx=pi/6.