Equation for finding a pair!!!

  int pair = n*(n-1)/2;

Comments