Let's consider the names of 22 people as A,B,C,D......V.
So firstly A decides to make handshakes with 21 other people.
Hence 21 handshakes.
Secondly B decides to make handshakes. But he has already shaken hands with A. Thus he is left with only 20 people to make handshakes.
Thus 20 handshakes.
Similarly C - 19
D - 18
E - 17
..........U-1 V-0
So total number of handshakes = 1+2+3+.......+20+21.
which is the sum of natural numbers from 1 to 21 = 21*(21+1)÷2
=21*22÷2
=21*11
=231
Generallythe formula to count handshakes is
n*(n−1)/2
Where n is the number of people