Guest User

Untitled

a guest
Oct 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. !
  2. ! Quadratic equation solver
  3. !
  4.  
  5. PROGRAM QuadraticEquation
  6.     IMPLICIT NONE
  7.     REAL :: A, B, C
  8.     REAL :: D
  9.    
  10.     WRITE(*,*) 'Enter A, B, C : '
  11.     READ(*,*)  A, B, C
  12.    
  13.     D = SQRT(B*B - 4 * A * C)
  14.    
  15.     WRITE(*,*) 'Positive solution : ', (-B + D)/(2.0*A)
  16.     WRITE(*,*) 'Negative solution : ', (-B - D)/(2.0*A)
  17.    
  18. END PROGRAM QuadraticEquation
Add Comment
Please, Sign In to add comment