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

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(" ");

}

Classwork_1.2: Write a program in C for a 2D array of a size entered by user to input and display the size of a matrix. Write the program here and run it in DEV C: Sample Output: C:\Users\mobenque\Desktop\Applied Programming_Summer_2018\Progra Find the sum of rows an columns of a Matrix: Input the size of the square matrix : 2 Input elements in the first matrix : element [@], [@] : 1 element [@],[1] : 2 element [1], [@] : 3 element [1],[1] : 4 The matrix is : 1 2 3 4 Process exited after 4.708 seconds with return value Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!