7:52 pm - Thursday April 25, 2019

Math Example Program for sqrt(double a)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
//Example program for to find sqrt(double a) in java
/**
 * @author:candidjava.com
 * @description:to find the Square root value of given value.
 */
public class SqrtExample {
	public static void main(String[] args) {
		double n1 = Math.sqrt(12);
		double n2 = Math.sqrt(144);
		System.out.println("The Square root value :" + n1);// it give sqrt value
															// of 12
		System.out.println("The Square root value :" + n2);// it give sqrt value
															// of 144
	}
}

Output:
The Square root value:3.4641016151377544
The Square root value:12.0

Filed in: Z-A All Java Codes

Comments are closed.