Infosys Interview Question

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