Run Code
|
API
|
Code Wall
|
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
1
swastik
break
Pipes
Max palindrome string
exp 1
Ab
JAVA # 20 RASTGELE SAYIDAN EN BÜYÜĞÜNÜ BULMAK
JAVA sidebar pattern match
true false
Project Euler #2