This question was asked in Ex 13.3, 4
Why we do this question by Pythagoras theorm

Kirti Jain's image