Arrays - Sum of two Matrices

I am getting a segmentation fault. What is the error in my code?

The issue is in the printing in the final array arr, since you’re following 0 based indexing in code, print the array arr[]
Print down all the elements from index k-1 down to 0.
I’ve made appropriate changes in your code.
PRO TIP: Try dry running your code in some corner cases at the time of segmentation fault, mostly it is because we try to access something that does not exist.

1 Like

Okay! Thank you! Got my mistake.
Thanks a lot for the pro tip as well. I ll keep that in mind!