Advertisement
Bishwajit123

Quadratic equation2

Jan 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1.  
  2. import cmath
  3.  
  4.  
  5. a=int(input("Enter a: "))
  6. b=int(input("Enter b: "))
  7. c=int(input("Enter c: "))
  8.  
  9. d = (b**2) - (4*a*c)
  10. s1 = (-b-cmath.sqrt(d))/(2*a)
  11. s2 = (-b+cmath.sqrt(d))/(2*a)
  12.  
  13. print('The Roots are {0} and {1}'.format(s1,s2))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement