Answer to Question #162750 in C++ for Aarati

Question #162750

Write a program that takes as input two numbers n (integer) and x (double), and prints arctan(x) evaluated by taking n terms of the Taylor series (using x0 =0):

arctan(x) = x - x 3 /3 + x 5 /5 - x 7 /7 …


To care of numerical accuracy and rounding off we have created a print(x) function. Please use this to print your final answer. Suppose your answer is in a variable called ans, then print it to screen using “print(ans);” and NOT “cout << ans;”.


Please print a newline( using “cout<<endl;” is one way to do it) after printing your answer


1
Expert's answer
2021-02-15T02:41:53-0500
#include<iostream>

Using namespace std;

Int main(){

Into x,y;

Cout<<'' Enter value of x''<<endl;

Cin>>x

Cout<<''enter the value''<<endl;

Cin>>n




(x) = x - x 3 /3 + x 5 /5 - x 7 /7




Print(x);

Return 0;

}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment