Analysis of Algorithms | Big | C # program for above approach ; Function to print all possible pairs ; Driver Code ; Given array ; Store the size of the array ; Function Call
using System ; class GFG { static void print ( int [ ] a , int n ) { for ( int i = 0 ; i < n ; i ++ ) { for ( int j = 0 ; j < n ; j ++ ) { if ( i != j ) Console . WriteLine ( a [ i ] + " ▁ " + a [ j ] ) ; } } } static void Main ( ) { int [ ] a = { 1 , 2 , 3 } ; int n = a . Length ; print ( a , n ) ; } }