Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Bissection Method
PROGRAM Bisection_Method IMPLICIT NONE REAL::a,b,c,ero,f ero = 0.00001 !WRITE(*,*)"Enter Value of a=" !READ(*,*) a !WRITE(*,*)"Enter Value of b=" !READ(*,*)b a=1.0 b=3.0 IF (f(a)==0)THEN WRITE(*,*)"Root of the given equation is : ",a ELSEIF (f(b)==0) THEN WRITE(*,*)"Root of the given equation is :",b ELSEIF (f(a)*f(b)>0) THEN WRITE(*,*)"Root(s) of the given equation doesn't existbetween",a,"and",b ELSE DO WHILE ((b-a)>ero) c=(a+b)/2 IF(f(c)==0)THEN EXIT ELSEIF(f(a)*f(c)<0)THEN b=c ELSE a=c END IF END DO WRITE(*,*)"Root of the given equation is :",c END IF END PROGRAM Function f(x) IMPLICIT NONE REAL::f,x f = x**3-2*x-5 End Function
run
|
edit
|
history
|
help
0
Hello / fortran
SIUM(3.7)
Fixed point for several variables
finitos
Jacobi
Subroutine problem
machine epsilon
euler-cromer
Chebyshev practice
euler-cromer