Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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.
Product of Array Except Self
do while
BFS in graph
dimond of stars
Minimum Vertices to Traverse Directed Graph
JAVA regex for only allow numbers
Wenfeng Ou
Meena
Add Index of max number in an array
상속2
Please log in to post a comment.