In this program, the user will give a 3x3 matrix and we will print it and also find the sum its main diagonal element & display it.