A utility function to print the constructed MST stored in parent [ ] and print Minimum Obtaiable product
int printMST ( int parent [ ] , int n , int graph [ V ] [ V ] ) { printf ( " Edge ▁ Weight STRNEWLINE " ) ; int minProduct = 1 ; for ( int i = 1 ; i < V ; i ++ ) { printf ( " % d ▁ - ▁ % d ▁ % d ▁ STRNEWLINE " , parent [ i ] , i , graph [ i ] [ parent [ i ] ] ) ; minProduct *= graph [ i ] [ parent [ i ] ] ; } printf ( " Minimum ▁ Obtainable ▁ product ▁ is ▁ % d STRNEWLINE " , minProduct ) ; }