As like,
AC = sqrt((AB*AB)+(BC*BC));
BD = sqrt((BC*BC)+(CD*CD));
(where all variables are double type)
Here, i want the value of AC and BD fixed with 2 digits after decimal point and then I want to add AC and BD. Now, if i take (3 digits after decimal point) AC=4.564 and BD=4.789 the the result after adding them is 9.351. Again if i take (2digits after decimal point) AC=4.56 and BD=78 then the result after adding them is 9.34. Now if i print both result fixed with 2 digits after decimal point then it shows 9.35 and 9.34 respectively. But I want 9.34 as result.