Geeksforgeeks

Error

×

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 | |

Handle | Score |

@avaiesshaik782 | 662 |

@arpitsatnalika | 629 |

@code_it_ | 591 |

@prakharxyz | 583 |

@tujhekya | 542 |

@Rahul Jadhav 1 | 458 |

@sivanandh03 | 448 |

@satyam0460 | 433 |

@iamronak | 424 |

@imnm | 424 |

@18eumc107 | 421 |

Complete Leaderboard |

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}

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?

Yes
Area of a triangle

...

Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.