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[]) { double d,e,a,b,c; Scanner tx=new Scanner(System.in); System.out.println("Enter the coefficient of variable x²"); a=tx.nextDouble(); System.out.println("Enter the coefficient or variable x"); b=tx.nextDouble(); System.out.println("Enter the coefficient with no variable"); c=tx.nextDouble(); d=(-b+Math.sqrt(Math.pow(b,2)-4*a*c))/(2*a); e=(-b-Math.sqrt(Math.pow(b,2)-4*a*c))/(2*a); System.out.println("The value or x is "+d+" or "+e); } }
run
|
edit
|
history
|
help
0
nice
by Dami, 6 months ago
Please
log in
to post a comment.
OBF-7 PR
queue_using_stack
Java tester
Current date and time in java
Magic No.
A
Parse and flatten string
javajava
else weird
else if statement
nice
by Dami, 6 months agoPlease log in to post a comment.