3:53 pm - Thursday March 24, 6101

Java program for square root of a number

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

/**

*@author:CandidJava.com

*@description :This program explain finding square root of number by using sqrt() from math class

*/

class FindSquareRoot {

public static void main(String[] args)  {

// to print square root of number by using math.sqrt()

System.out.println(Math.sqrt(1050625));

System.out.println(Math.sqrt(625.5));

}

}

Output:

D:\ Candidjava>Code >javac FindSquareRoot.java

D:\ Candidjava>Code >java FindSquareRoot

1025.0

25.0099980007996

Filed in: Z-A All Java Codes

No comments yet.

Leave a Reply