A. To give you right of way
B. To attract a friend's attention
C. To warn others of your presence
D. To make slower drivers move over
Try the question by clicking here
Highway Code rule 112 states:
The horn. Use only while your vehicle is moving and you need to warn other road users of your presence. Never sound your horn aggressively. You MUST NOT use your horn
except when another road user poses a danger.
The function of the horn is to alert other road users to your presence, not to, for example, let people know you are leaving a house.