answersLogoWhite

0


Best Answer

M

#include<stdio.h>

#include<conio.h>

int main()

{

int a[3][3], b[3][3], sum[3][3], i,j;

clrscr();

printf("Enter the first matrix");

for(i=0;i<3;i++)

for(j=0;j<3;j++)

scanf("%d", &a[i][j]);

printf("Enter the second matrix");

for(i=0;i<3;i++)

for(j=0;j<3;j++)

scanf("%d", &b[i][j]);

printf("\nThe first matrix is \n");

for(i=0;i<3;i++)

{

printf("\n");

for(j=0;j<3;j++)

printf("%d\t", a[i][j]);

}

printf("\nEnter the second matrix");

for(i=0;i<3;i++)

{

printf("\n");

for(j=0;j<3;j++)

printf("%d\t", b[i][j]);

}

for(i=0;i<3;i++)

for(j=0;j<3;j++)

sum[i][j]=a[i][j]+ b[i][j];

printf("\n The addition of two matrix is \n");

for(i=0;i<3;i++)

{

printf("\n");

for(j=0;j<3;j++)

printf("%d\t", sum[i][j]);

}

getch();

return 0;

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program - to perform matrix addition?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is matrix programming in C programming?

C Examples on Matrix OperationsA matrix is a rectangular array of numbers or symbols arranged in rows and columns. The following section contains a list of C programs which perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns.The section also has programs on finding the trace of 2 matrices, calculating the sum and difference of two matrices. It also has a C program which is used to perform multiplication of a matrix using recursion.C Program to Calculate the Addition or Subtraction & Trace of 2 MatricesC Program to Find the Transpose of a given MatrixC Program to Compute the Product of Two MatricesC Program to Calculate the Sum & Difference of the MatricesC Program to Perform Matrix Multiplication using Recursion


How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


Write a c program to determine whether a matrix is singular or not?

A c program is also known as a computer program. A singular matrix has no inverse. An equation to determine this would be a/c=f. &lt;&lt;&gt;&gt; The determinant of a singular matix is zero.


What is the product of matrix A and C?

It's matrix C.


Write a program to display Identity matrix?

#include &lt;stdio.h&gt; void main() { int a,b,c,i,j; printf("Enter the number of rows for square matrix : "); scanf("%d",&amp;a); for(i=1;i&lt;=a;i++) { for(c=1,j=1;j&lt;=a;j++,c++) { if(c==i) printf("1 "); else printf("0 "); } printf("\n"); } getch(); }

Related questions

C Matrix addition program?

How we can addition Two Matrix plz send coding in C language mahesh dhanotiya astah_mahesh@rediff.com how i can built a square matrix in c,


What is matrix programming in C programming?

C Examples on Matrix OperationsA matrix is a rectangular array of numbers or symbols arranged in rows and columns. The following section contains a list of C programs which perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns.The section also has programs on finding the trace of 2 matrices, calculating the sum and difference of two matrices. It also has a C program which is used to perform multiplication of a matrix using recursion.C Program to Calculate the Addition or Subtraction & Trace of 2 MatricesC Program to Find the Transpose of a given MatrixC Program to Compute the Product of Two MatricesC Program to Calculate the Sum & Difference of the MatricesC Program to Perform Matrix Multiplication using Recursion


Write a c program for matrix addition using function?

#include&lt;


How do you write c program to perform sum of elements of matrix using pointers with functions?

i cant write


How do you Write a C program for matrix addition?

for (i=0; i&lt;IMAX; i++) for (j=0; j&lt;JMAX; j++) c[i,j] = a[i,j] + b[i,j];


How do you perform matrix addition?

By elements in dual loop. for (i=0; i&lt;n; ++i) for (j=0; i&lt;m; ++j) c[i][j] = a[i][j] + b[i][j];


How do you Write A program in c language for checking a diagonal matrix?

Write a program in c++ that take input in a integer matrix of size 4*4 and find out if the entered matrix is diagonal or not.


If properties of matrix addition let A B C D the m n matrix then 1 A plus B B plus A?

Yes. Matrix addition is commutative.


Write a c program to determine whether a matrix is singular or not?

A c program is also known as a computer program. A singular matrix has no inverse. An equation to determine this would be a/c=f. &lt;&lt;&gt;&gt; The determinant of a singular matix is zero.


A c program to square matrix?

A C program to square matrix is a math problem. In the math problem you write down all the outer boundary values of matrix in a circle, then write down the inner value.


Program to display multiplication of two matrix?

The matrix multiplication in c language : c program is used to multiply matrices with two dimensional array. This program multiplies two matrices which will be entered by the user.


A c program to find maximum number in a 3 by 3 matrix?

int matrix[][]; // the matrix to find the max in int max = matrix[0][0]; int r,c; for(r = 0; r &lt; 3; ++r) { for(c = 0; c &lt; 3; ++c) { if(matrix[r][c] &gt; max) { max = matrix[r][c]; } } } // max is now the maximum number in matrix