// pair is not considered if (sum - arr[i] == arr[i]) { twice_count--; } } // return the half of twice_count return twice_count / 2; } // Driver Code public static void Main(string[] args) { int sum = 6; Console.WriteLine("Count of pairs is " + getPairsCount(arr.Len...