Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Quadratic equation
//'main' method must be in a class 'Rextester'. //Compiler version 1.8.0_111 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { Scanner sc=new Scanner(System.in); double a,b,c,x,y; System.out.println("Enter the three coefficients"); a=sc.nextDouble(); b=sc.nextDouble(); c=sc.nextDouble(); x=(-b+Math.sqrt(b*b-4*a*c))/(2*a); y=(-b-Math.sqrt(b*b-4*a*c))/(2*a); System.out.println("roots are"+x+"and"+y); } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
ABC`s
Implement Queue with Limited Size of Arrays
JAVA # Dizi Ortalama
Add Index of max number in an array
Java recursive test
Odd Occurence Problem Template
[Java] Coding - Reverse CODE - Mathematical Method
Reverse Prime
2darray
Relation
stackse - search stackoverflow differently
Please log in to post a comment.