Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Question1(b)
program false implicit none real::a,b,f,x,tol,xv integer::itrtn,i print*, "Enter the initial values (a,b):" read(*,*)a,b if( (f(a)*f(b)) .gt.0) then write(*,*)"Can not be done", f(a), f(b); stop end if print*, "Enter the number of iteration:" read(*,*)itrtn print*, "Enter the tolerance:" read(*,*)tol do 10 i = 1, itrtn xv = (a * f(b) - b* f(a)) / (f(b)-f(a)) if(f(xv).eq.0) then print*,"The soln is: ",xv stop end if if(f(a)*f(xv).le.0) then b = xv print*,a,b else a = xv print*,a,b end if if(abs(a-b).le.tol) then print*, "The approximate soln is: ",xv stop end if 10 continue print*,"Maximum iteration failed" end program real function f(x) real::x f = x**3 - 2*x -5 return end function
run
|
edit
|
history
|
help
0
A_04 TRAPEZOIDAL RULE (3(I))
Exercise 02
Won rules summation 1 to 100 square namber
A program to calculate potential energy.
8
Ashish.txt
Shooting
Q1a
A_02 GUASS SEIDEL METHOD
A_02 questions 3