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
JavaQ5b
JAVA # Dizi Ortalama
Ip address
Coding Numbers - Polindrome
PE #6
Printing
strstr() function / indexOf() function
pow x^n
Ip address
Application