PROGRAM qe IMPLICIT NONE !declaring variables REAL::a,b,c,d,root1,root2,val PRINT *, '============================================' PRINT *, 'PROGRAM TO CALCULATE ROOTS OF A QUADRATIC EQUATION [REAL ROOTS ONLY] [ BY WWW.BOTTOMSCIENCE.COM ]' PRINT *, '============================================' PRINT *,'Please enter the value of cofficients a, b, and c respectively as per the equation - ax^2 + bx + c' READ(*,*)a,b,c !calculating the square root part -> square root(b^2-4ac) val=((b**2)-(4*a*c)) d=SQRT(val) root1=(-b+d)/(2*a) root2=(-b-d)/(2*a) PRINT *,'Calculated real roots are - root 1 = ',root1 ,'root 2 = ', root2 END PROGRAM OUTPUT![]() |
Fortran Programming
Numerical Methods
- Bisection Method
- Regula Falsi (False Position)
- Newton Raphson Method
- Secant method
- Newton Raphson – Non-Linear Equations
- Gauss Elimination Method
- Gauss Elimination Method (With Pivoting)
- Gauss Jordan Method
- Gauss Elimination – Determinant
- Gauss Jordan – Inverse Matrix
- Lagrange Interpolation
- Newton Divided Interpolation
- Newton Forward Interpolation
- Least Square Fitting
- Trapezoidal Rule
- Simpson 1/3rd Rule
- Simpson 3/8 Rule
- Euler’s Method
- Euler’s Modified Method
- Runge Kutta’s (2nd Order)
- Runge Kutta’s (4th Order)
![OUTPUT - QUADRATIC EQUATION [REAL ROOTS ONLY]](https://www.bottomscience.com/wp-content/uploads/2021/02/2.-OUTPUT-QUADRATIC-EQUATION-REAL-ROOTS-ONLY.jpg)