Infosys interview question

write a code to find the sum of diagonal elements in a matrix