1. Write a C-program to evaluate numerically the roots of the following equation
ID: 3620876 • Letter: 1
Question
1. Write a C-program to evaluate numerically the roots of the following equation.3x3 - 5.0x2 + log10(abs(x))+2=0
Search for the potential roots (x values) in the following range for x: -8<= x<= +8.
Your program will count the total number of iterations it took to find all the roots, and also the total number of solutions obtained, and print the results on screen.
Solve the above for the following scenerio.
Use an x-increment of 0.05, and maximum error allowed <=0.05.
A typical out-put on the screen would look like the following:
A Root is at x = -0.149988
A Root is at x = 0.150012
A Root is at x = 0.900012
A Root is at x = 0.950013
A Root is at x = 1.000013
A Root is at x = 1.050012
A Root is at x = 1.100012
It took 321 iterations to solve this equation
There are 7 roots for this equation.
Press any key to continue . . .
Explanation / Answer
Dear, Here is the code.. #include #include #include void main() { float x=-8; double exp; int roots=0,iter=0; clrscr(); while(x=-0.05&&expRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.