I've never seen a real GMAT question where you'd need the formula kanha uses above, but it's certainly correct. You can prove it fairly easily, though it's a bit tricky to explain without a diagram:
-draw the circle inside the triangle, and draw a radius to all three points where the circle touches the triangle;
-notice the triangle's edges are tangent to the circle, so you have a 90 degree angle at each of the three points where the radius connects to a triangle's edge;
Now the stuff that's much easier to see with a diagram:
-when you've drawn the three radii, you've divided up the triangle into a square with sides of length r, and two 'kites' (quadrilaterals which have adjacent sides of equal length);
-If the base has length a, the side of the kite along the base has length a-r;
-if the height has length b, the side of the kite along the height has length b-r;
-notice now that the hypotenuse is made up of one side of the first kite, and one side of the second. So, if c is the length of the hypotenuse, we have:
c = (a - r) + (b - r)
c = a + b - 2r
r = (a + b - c)/2
For online GMAT math tutoring, or to buy my higher-level Quant books and problem sets, contact me at ianstewartgmat at gmail.com
ianstewartgmat.com