Handshakes Python

PROGRAM TO COUNT THE NUMBER OF HANDSHAKES SUCH  THAT A PERSON SHAKES HANDS ONLY ONCE



def handshake(n): 
      
    return int(n * (n - 1) / 2)
  
# Driver Code
n = 9
print(handshake(n))


OUTPUT
36

Comments

Popular posts from this blog

Solve the Sudoku Python

Solve the Sudoku Java

Find Duplicates Java