fork download
  1. a = int(input("Enter the coefficients of a: "))
  2. b = int(input("Enter the coefficients of b: "))
  3. c = int(input("Enter the coefficients of c: "))
  4.  
  5. d = b**2-4*a*c # discriminant
  6.  
  7. if d < 0:
  8. print ("This equation has no real solution")
  9. elif d == 0:
  10. x = (-b+math.sqrt(b**2-4*a*c))/2*a
  11. print (("This equation has one solutions: "), x)
  12. #add the extra () above or it does not show the answer just the text.
  13. else:
  14. x1 = (-b+math.sqrt((b**2)-(4*(a*c))))/(2*a)
  15. x2 = (-b-math.sqrt((b**2)-(4*(a*c))))/(2*a)
  16. print ("This equation has two solutions: ", x1, " or", x2)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
a = int(input("Enter the coefficients of a: "))
^
Main.java:5: error: illegal character: '#'
d = b**2-4*a*c # discriminant
               ^
Main.java:12: error: illegal character: '#'
#add the extra () above or it does not show the answer just the text.
^
3 errors
stdout
Standard output is empty