// Sqrt program
class ssvsqrt
{
public static void main(String args[])
{
System.out.print("\n\n\n | ");
for(double j=0.0;j<=0.9;j+=0.1)
if ((j > 0.7) && (j < 0.9)) { j = 0.8;System.out.print(j+" "); }
else
System.out.print(String.valueOf(j).substring(0,3)+" ");
System.out.print("\n -----|---------------------------------------------------------------------");
System.out.print("\n \n | \n ");
for(double i=0.0;i<=9.0;i++)
{ System.out.print(i + " | ");
for(double j=0.0;j<=0.9;j+=0.1)
{
if ( (Math.sqrt(i+j) == 0.0) || (Math.sqrt(i+j) == 1.0)|| (Math.sqrt(i+j) == 2.0)|| (Math.sqrt(i+j) == 3.0))
System.out.print(Math.sqrt(i+j)+ " ");
else
System.out.print(String.valueOf( Math.sqrt(i+j)).substring(0,4) + " ");
}
System.out.print("\n " );
}
}
}In this program, easy to understand to Square Root calculation for given numbers using Java Program
