C++ Programming
Determine the roots of the function with errors of less than 0.1%
for x values between -5 and 5. you MUST NOT utilize the "if"
statement in your code. Use the Newton-Raphson method.
f(x) = sin(x)
SOLUTION:-
PROGRAM
#include<bits/stdc++.h>
using namespace std;
int main()
{
cout<<"Values of sin(x) for x values from -5 to 5\n\n";
cout<<"x"<<"\t"<<"sin(x)\n";
for(double i=-5;i<=5;i=i+0.5)
{
cout<<"\n"<<i<<"\t"<<sin(i);
}
return 0;
}
IMAGE OF
PROGRAM
IMAGE OF OUTPUT
THANK YOU, if any queries please leave your valuable comment on comment box..........
If possible please rate the answer as well..........
Get Answers For Free
Most questions answered within 1 hours.