/*
Given an array of numbers. Print all the pairs (2) of numbers in the array if the sum of those numbers is also present in the array.
Input
int a[] = {10, 5, 2, 7, 7, 49}
Output (5,2)
*/
using System;
public class Program
{
public static void Main()
int[] a = new int[]{10, 5, 2, 7, 7, 49, 12};
for(int i=0;i<a.Length-1;i++)
for(int j=i+1;j<a.Length;j++)
int s=a[i]+a[j];
if(Array.FindIndex(a,0, p=>p==s)>=0)
Console.WriteLine("{0}, {1}",a[i],a[j]);
}