Lets say we have a triangle.

We know two angles of measurement for this triangle. Let's say we know that one angle is equal to 90o, the other equal to 40o.
How would you go about finding the measurement of the third angle? Well, since we know the angles of all triangles add up to 180o, we can make an equation to solve for the missing angle.
Lets call the missing angle A.
Equation: 180 = 90 + 40 + A
Simplify: 180 = 130 + A
Subtract: 50 = A
We used the same principals to get the measurement of the third angle in our diagram.