function to print segregated array
static void print ( int [ ] arr , int n ) { Console . WriteLine ( " Array ▁ after ▁ segregation ▁ is ▁ " ) ; for ( int i = 0 ; i < n ; i ++ ) Console . Write ( arr [ i ] + " ▁ " ) ; }