Question: i solve it this way. but when I run it I get this error (exited, bus error) where is the mistake #include int main() {

i solve it this way. but when I run it I get this error (exited, bus error)
where is the mistake
#include
int main()
{
int i,j,n;
int arr1[n][n];
printf("Find the sum of rows and columns of a Matrix: ");
printf("--------------------------------------------- ");
printf("Input the size of the square matrix : ");
scanf("%d",&n);
printf("Input elements in the first matrix : ");
for(i=0;i { for(j=0;j { printf("element - [%d],[%d] : ",i,j); scanf("%d",&arr1[i][j]); } } printf("The matrix is : "); for(i=0;i { printf(" "); for(j=0;j printf("%d\t",arr1[i][j]); } printf(" "); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
