...

/

Challenge: Add Main Diagonal Elements in a Matrix

Challenge: Add Main Diagonal Elements in a Matrix

Test your knowledge by solving a challenge in this lesson.

Problem statement

Your task is to write a function add_diagonal. Your function signature would be:

The input array arr[ ][ ] will ...