-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpression.java
More file actions
43 lines (27 loc) · 1.08 KB
/
Expression.java
File metadata and controls
43 lines (27 loc) · 1.08 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
37
38
39
40
41
42
43
// Write a program to find calculate of area
import java.lang.*;
import java.util.*;
public class Expression {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int a,b,c;
double s,area;
System.out.println("Enter 3 Sides of a Triangle: ");
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
s=(a+b+c)/2f;
area=Math.sqrt(s*(s-a)*(s-b)*(s-c));
System.out.println("Area of Triangle is: "+area);
}
}
//#################################################################################################################################################################################//
///////////////////Output///////////////////
// Enter 3 Sides of a Triangle: //
// 87 //
// 89 //
// 52 //
// Area of Triangle is: //
////////////////////////////////////////////
// Thanks You
// Bye