A triangle with sides 7,24,25 is a right triangle with side 25 as the hypotenuse.
For the angle bounded by the adjacent sides 7 and 25, the cosine is 7/25.
For the angle bounded by the adjacent sides 24 and 25, the cosine is 24/25.
As expected, the angle bounded by the sides 7 and 24 is a right angle.