follow

Wednesday, 7 August 2013

Math class : JAVA Programming by "Gopal Krishna"

public class mt
{
public static void main(String arg[])
{

int result=Math.abs(-98);
System.out.println("the value="+result);
System.out.println("the abs(-199)value="+Math.abs(-199));
System.out.println("the ciel(3.1)value="+Math.ceil(3.1f));
System.out.println("the floor(3.1value="+Math.floor(3.1f));
System.out.println("the max(1,99)value="+Math.max(1,99));
System.out.println("the min(1,99)value="+Math.min(1,99));
System.out.println("the round(38.975));value="+Math.round(38.975));
System.out.println("the random(0,1)value="+Math.random()*1);
System.out.println("the sqrt(16)value="+Math.sqrt(16));
System.out.println("the sin(45)value="+Math.sin(45));
System.out.println("the cos(45)value="+Math.cos(45));
System.out.println("the tan(45)value="+Math.tan(45));
System.out.println("the value="+Math.pow(2,4));

}
}

No comments:

Post a Comment