Question: Write a program (3 versions: C, Python and PHP) that calculates the area of a triangle given its three sides. The formula or algorithm used

 Write a program (3 versions: C, Python and PHP) that calculates

Write a program (3 versions: C, Python and PHP) that calculates the area of a triangle given its three sides. The formula or algorithm used is: Area = (s(s - a)(s - b)(s - c)) Where: s= perimeter-(a+b+c)/2 and a, b & c are the sides of triangle. You should implement 2 method besides your main code: 1. Perimeter method that need the value of the 3 sides (a,b,c) to find the value of s 2. Area method that need the value of the 3 sides (a,b,c) and Perimeter(s) Notes: 1. In C, you can import math header file to be able use square root method (sqrt) 2. How you can only show 2 digit after the decimal point without using any format method in Python and PHP? 3. In C you can show 2 digit after the decimal point as in 'printf in java, how? 4. How you can find the square root in Python and PHP without using any special method? 5. Make sure to select suitable data types. Sample Output: Enter the values of a, b and c 12 10 8 Area of a triangle = 39.68

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!