take new largest value
if ( mat [ n - 1 - i ] [ i ] > secondaryMax ) { secondaryMax = mat [ n - 1 - i ] [ i ] ; } } cout << " Principal ▁ Diagonal ▁ Smallest ▁ Element : ▁ " << principalMin << " STRNEWLINE " ; cout << " Principal ▁ Diagonal ▁ Greatest ▁ Element ▁ : ▁ " << principalMax << " STRNEWLINE " ; cout << " Secondary ▁ Diagonal ▁ Smallest ▁ Element : ▁ " << secondaryMin << " STRNEWLINE " ; cout << " Secondary ▁ Diagonal ▁ Greatest ▁ Element : ▁ " << secondaryMax ; }