----------------------------------------------------------------------------------------------------------------------------------------
PROGRAM daraje_2
IMPLICIT NONE
REAL::a,b,c,x1,x2,delta
PRINT*
PRINT*," 2 "
PRINT*," aX + bX + c = 0 ===>> a , b , c = ?"
PRINT*
PRINT*," a : "
READ*,a
PRINT*," b : "
READ*,b
PRINT*," c : "
READ*,c
PRINT*
PRINT*,"-----------------------------------------------------------------"
PRINT*
delta=(b**2)-(4*a*c)
IF (delta>0) THEN
x1=(-b+SQRT(delta))/(2*a)
x2=(-b-SQRT(delta))/(2*a)
PRINT*," X(1) =",x1
PRINT*
PRINT*," X(2) =",x2
PRINT*
ELSE
IF (delta==0) THEN
x1=-b/(2*a)
PRINT*," X =",x1
PRINT*
ELSE
x1=-b/(2*a)
x2=-delta/(2*a)
PRINT*," X(1) and X(2) are complex : "
PRINT*
PRINT*," X(1) =",x1,"+",x2,"i"
PRINT*
PRINT*," X(2) =",x1,"-",x2,"i"
PRINT*
END IF
END IF
PRINT*,"-----------------------------------------------------------------"
END