-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMath1.java
More file actions
22 lines (19 loc) · 888 Bytes
/
Math1.java
File metadata and controls
22 lines (19 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package com.CodeWithSarnav;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int x,y;
Scanner s=new Scanner(System.in);
System.out.print("Enter 1st number: ");
x=s.nextInt();
System.out.print("Enter 2nd number: ");
y=s.nextInt();
System.out.println("Maximum number is "+Math.max(x,y));
System.out.println("Minimum number is "+Math.min(x,y));
System.out.println("Power value is "+Math.pow(x,y));
System.out.println("Natural log is "+Math.log(x)+" and "+Math.log(y));
System.out.println("Square root of is "+Math.sqrt(x)+" and "+Math.sqrt(y));
System.out.println("Absolute value is "+Math.abs(x)+" and "+Math.abs(y));
System.out.println("The pseudo random double type integer between 0 and 1 is "+Math.random());
}
}