Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
51 lines (40 loc) · 1.43 KB

File metadata and controls

51 lines (40 loc) · 1.43 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.tutorial.four;
import java.util.Scanner;
public class MathClassTest {
public static void main(String args[])
{
double temp;
System.out.println("exp(1.0) is " + Math.exp(1.0));
System.out.println("exp(10.0) is " + Math.exp(10.0));
System.out.println("exp(0.0) is " + Math.exp(0.0));
System.out.println("log(1.0) is " + Math.log(1.0));
System.out.println("log(10.0) is " + Math.log(10.0));
System.out.println("log(Math.E) is " + Math.log(Math.E));
System.out.print("Enter any value:");
Scanner in = new Scanner(System.in);
double value = in.nextDouble();
System.out.println("Absolute Method: "+Math.abs(value));
System.out.println("Floor Method: "+Math.floor(value));
System.out.print("Enter any another value:");
double value2 = in.nextDouble();
System.out.print("Enter any another another value:");
double value3 = in.nextDouble();
System.out.print("Enter any another value:");
double value4 = in.nextDouble();
in.close();
double[] arraysint = {value, value2, value3, value4};
int num = 4;
for (int i = 0; i < ( num - 1 ); i++) {
for (int j = 0; j < num - i - 1; j++) {
if (arraysint[j] < arraysint[j+1])
{
temp = arraysint[j];
arraysint[j] = arraysint[j+1];
arraysint[j+1] = temp;
}
}
}
for (int i = 0; i < num; i++)
System.out.println(arraysint[i]);
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.