program main implicit none real :: a,b,c,d,r1,r2 print*, "enter the values ofa,b,c in equation ax**2 + bx + c= 0" read*, a,b,c d = b**2 - 4*a*c if (d.gt.0) then print*, "roots are real" r1 = (-b+d**0.5)/(2*a) r2 = (-b-d**0.5)/(2*a) print*, "the value of r1= ", r1 print*, "the value of r1= ",r2 else if (d.lt.0) then print*, "roots are imaginary" else if (d.eq.0) then print*, "roots are equal", d endif end program main
To embed this project on your website, copy the following code and paste it into your website's HTML: