Leaderboard
Showing:
Handle Score
@Ibrahim Nash 5725
@blackshadows 5685
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4908
@saiujwal13083 4156
@sanjay05 3762
@marius_valentin_dragoi 3511
@sushant_a 3453
@KshamaGupta 3318
@the_coder95 3302
Complete Leaderboard
Area of a triangle
Basic Accuracy: 32.44% Submissions: 37 Points: 1

Given three sides of a triangle A, B and C in the form of integers. Find the area of the triangle.
Note: The triangle may not exist. In such cases, the area is 0.

Example 1:

Input: A = 2, B = 2, C = 3
Output: 1.984313
Explanation:
The area formed by the triangle whose
sides are 2,2 and 3 units respectively is 
1.984313 units2.

Example 2:

Input: A = 1, B = 3, C = 1
Output: 0.000
Explanation:
Such a triangle does not exist whose 
sides are 1,3 and 1 respectively.Thus,Area is
0.


Your Task:
You don't need to read input or print anything.Your Task is to complete the function findArea() which takes three integers A,B and C as input parameters and returns the area of the triangle formed by the three integers as sides.

Note: Output the answer upto 3 decimal points


Expected Time Complexity:O(1)
Expected Auxillary Space:O(1)


Constraints:
1<=A,B,C,<=104

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Area of a triangle

Output Window