Question 41948
Suppose there were 'n' people.
Then each shook hands with (n-1) people.
So total number of handshakes = {{{n(n-1)/2}}}
[Why divided by 2? The answer is whether person A shakes hand with person B or person B shakes hand with person A is immaterial as these two situations refer to a single handshake.]


For 22 and 35 students put n = 22 and 35 respectively and you will get 231 and 595 handshakes accordingly.