Friday, January 9, 2015

Square root function in Java

import java.lang.*;

public class xValue{
public static void main(String [] args){
double a=3, b=2, c=11, x=0;
x=(-b+Math.sqrt(b*b-4*a*c))/(2*a);
System.out.println("The value of x is:"+x);
}
}

No comments:

Post a Comment