This function prints all anagram pairs in a given array of strings
void findAllAnagrams ( string arr [ ] , int n ) { for ( int i = 0 ; i < n ; i ++ ) for ( int j = i + 1 ; j < n ; j ++ ) if ( areAnagram ( arr [ i ] , arr [ j ] ) ) cout << arr [ i ] << " ▁ is ▁ anagram ▁ of ▁ " << arr [ j ] << endl ; }