-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMasala3.java
More file actions
30 lines (19 loc) · 622 Bytes
/
Masala3.java
File metadata and controls
30 lines (19 loc) · 622 Bytes
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
import java.util.Scanner;
public class Masala3 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double a, b, c, p, s, S;
System.out.print("a = ");
a = scanner.nextDouble();
System.out.print("b = ");
b = scanner.nextDouble();
System.out.print("c = ");
c = scanner.nextDouble();
S = a*b*c;
System.out.println("Yuza = " + S);
p = (a + b + c) / 2 ;
System.out.println("p = " + p);
s = Math.sqrt(p * (p-a) * (p-b) * (p-c));
System.out.println("s = " + s);
}
}