-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMathClass.java
More file actions
36 lines (21 loc) · 1.17 KB
/
MathClass.java
File metadata and controls
36 lines (21 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
public class MathClass
{
public static void main(String args[])
{
double x = -100.6;
System.out.println("sin value of x="+Math.sin(x));
System.out.println("cos value of x="+Math.cos(x));
System.out.println("tan value of x="+Math.tan(x));
System.out.println("natural log value of x="+Math.log(x));
System.out.println("log to the base 10 value of x="+Math.log10(x));
System.out.println("square root value of x="+Math.sqrt(x));
System.out.println("2 raise to the power x="+Math.pow(2,x));
System.out.println("mod value of x="+Math.abs(x));
System.out.println("round off value of x="+Math.round(x));
System.out.println("previous integer value of x="+Math.floor(x));
System.out.println("next integer value of x="+Math.ceil(x));
System.out.println("maximum value out of two values="+Math.max(30,x));
System.out.println("minimum value out of two values="+Math.min(30,x));
System.out.println("random value between 0-10="+Math.random()*10);
}
}