Geeksforgeeks

Error

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 units^{2}.

**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,<=10^{4}

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

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

YesLoading...

Area of a triangle

...