AC = sqrt((AB*AB)+(BC*BC));
BD = sqrt((BC*BC)+(CD*CD));
If you're trying to print double values with 2 digits after the decimal then use modifiers to the conversion specifier like so:
printf ("%.2f", AC);
You should look at the round, ceil and floor functions and use them as follows:
ans = round (AC * 100.0) / 100.0
to do what you want. You'll find that you cannot represent all numbers as just two digits after the decimal so any comparisons you make should test for closeness of the answer to the target by +/- a small epsilon to the target value.
If you're trying to use the values computed for financial computation then this is very dangerous to do with the double type because certain values cannot be represented exactly with a limited number of bits of precision. You will suffer from accumulation of errors when performing financial computation with float/double types.