Heron.C:
Given a triangle with edge lengths a, b, c, the area of the triangle
is given by:
area = square-root( s (s-a) (s-b) (s-c) )where s is the semi-perimeter:
s = (a + b + c ) / 2Write a program which prompts for and inputs the 3 side lengths of a triangle, and uses Heron's formula to compute the area.
Euclidean.C:
Write the program Euclidean.C which accepts two integers called
i and j and finds the greatest common divisor of the two.
This is what they would each have to be divided by to place
i/j
in reduced form.
Check that i is not negative and j is neither negative nor zero,
and exit with a message to the user if this is not true.
For example:
Enter integer i: 85 Enter integer j: 153 The lowest common divisor is 17