driver program to test above function
int main ( ) { int mat [ 4 ] [ 4 ] = { { 10 , 20 , 30 , 40 } , { 15 , 25 , 35 , 45 } , { 25 , 29 , 37 , 48 } , { 32 , 33 , 39 , 50 } , } ; cout << "7th ▁ smallest ▁ element ▁ is ▁ " << kthSmallest ( mat , 4 , 7 ) ; return 0 ; }