Skip to content

Latest commit

 

History

History

herons-formula-1

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Write function heron which calculates the area of a triangle with sides a, b, and c (x, y, z in COBOL).

Heron's formula:

$$\sqrt{s * (s - a) * (s - b) * (s - c)}$$

where

$$s = \frac{a + b + c} 2$$

Output should have 2 digits precision.