Question: Why is my while loop not working. I want to keep decreasing the value of x in order to integrate the function but it does
Why is my while loop not working. I want to keep decreasing the value of x in order to integrate the function but it does not work and it keeps on either pronting the same value of x or decreasing it only once?

int n, i-2; double integral_1; double p; double L1 1; for (p 0.99 ; p > 0.98; p-=0.01){ double L2 - 0.99; integral-1-trapezoidal (f,L1, L2, ) ; printf("The integral is %1fin", integral-1); double a,b; a--10; b-20; bisection (a,b) printf("n"); printf( "Accurate Root calculated 1s-%1f ",c); double integral_2; double x1-c; double x2-0.005; double intergal_3- integral_2-integral_1; integral 2-simpsons (func,x1, x2,i); while (intergal_3>0.001) integral_2-simpsons (func, x1, x2,i); integral-1-trapezoidal (f, L1, 0.99, i) ; intergal 3- integral_2-integral_1; x1-x1-0.001 printf("The value of x1 is %1f ", x1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
