Driver program to test above
int main ( ) { int mat [ SIZE ] [ SIZE ] = { { 4 , 7 , 0 , 3 } , { 8 , 5 , 6 , 1 } , { 9 , 11 , 10 , 2 } , { 15 , 13 , 14 , 12 } } ; int n = 4 ; cout << " Total ▁ energy ▁ required ▁ = ▁ " << calculateEnergy ( mat , n ) << " ▁ units " ; return 0 ; }