Check whether sum is equal to target if it is equal , then print the subset
if ( sum == target ) { cout << ( " { " ) ; for ( int i = 0 ; i < set . size ( ) ; i ++ ) if ( x [ i ] == 1 ) cout << set [ i ] << " , ▁ " ; cout << ( " } , ▁ " ) ; } }