How to Write a C program to calculate sum of two m*n matrices & store the result in 3 matrix in C Programming Language ?
Solution:/*C Program to calculate sum of two m*n matrices & store the result in 3 matrix*/
#include<stdio.h>
#include<conio.h>
void main()
{
int m[10][10],n[10][10],p[10][10],i,j;
clrscr();
printf("\nEnter the elements of m: ");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&m[i][j]);
}
printf("\n");
}
printf("\nEnter the elements of n: ");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&n[i][j]);
}
printf("\n");
}
printf("\nEntered elements of m is:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("\t%d",m[i][j]);
}
printf("\n");
}
printf("\nEntered elements of n is:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("\t%d",n[i][j]);
}
printf("\n");
}
printf("\nAddition of matrix is: ");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
p[i][j]=m[i][j]+n[i][j];
}
printf("\n");
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("\t%d",p[i][j]);
}
printf("\n");
}
getch();
}
//OUTPUT:
//Enter the elements of m:
1
2
3
4
5
6
7
8
9
//Enter the elements of n:
1
2
3
4
5
6
7
8
9
//Entered elements of m is:
1 2 3
4 5 6
7 8 9
//Entered elements of n is:
1 2 3
4 5 6
7 8 9
//Addition of matrix is:
2 4 6
8 10 12
14 16 18
Learn More :
Two
- Write a c program to find out H.C.F. of two numbers.
- Write a C program to find maximum or equal between two numbers ?
- ADDITION OF TWO MATRICES USING C PROGRAM
- C Program To Find Product Of Two No Using MACRO
- C Program To Swap Two Numbers Without Using Third Variable
- C Program Concatenating Two Strings Into A Third System
- C Program to concatenate two strings without using string functions
- C Program to Interchanging Two Numbers
- C Program produsul scalar a doi vectori .
- C Program The dot product of two vectors
- C Program to two timing functions to measure process time
- C Program to swap the values of two variables by using call by reference
- Find the union and intersection of two sets of integer store it in two array C Program
- Menu driven program in C to Calculate Length, Copy into Another Compare Concatenate of Two String
- C Program To Multiply Two Polynomials
- Create Two Singly Linked List Perform Differences Display It C Program
- C Program to Input Student Details into a File For Two Subjects
- Adding two polynomial functions C Program Using Structure
- Program to Add Two Polynomials Using Linked List C Program
- Menu Driven Program to Read Two Integers Find Sum, Difference and Product C Program
- Input Two Numbers and Print Greater Number C Program
Calculate
- C Programm zur Berechnung von Umfang und Flächeninhalt verschiedener geomatrischer Figuren
- Napisać funkcję obliczającą funkcję geometryczną w tablicy NxM elementowej z elementów o wartościach parzystych znajdujących się pod główną i ponad przeciwną przekątną.
- C Program to Calculate GCD using recursion
- C Program To Calculate First Numbers Using Recursion
- C Program to Calculation of One Number Raised to Another
- C Program to calculate TT and Recharge Amount
- C Program to Calculate 2 numbers with 1 operation
- Un-sortiertes Array and Sortiertes Array
- C Program Calculation of Simple Interest
- C Program to Calculation of Total and Percentage
- C Program for calculation of Gross Salary
- C Program to calculate Area, Perimeter of Rectangle; Area, Circumference of Circle.
- C program calculates a given function in range given by user, stores the data in arrays and displays the answer in a table.
- C Program for statistically calculating pi using a specific scheduling policy.
- C Program that prompts the user to input a string, (whitespaces allowed)
- C Program Number of Judge and Score From Each Judge
- C Program to Calculate the mathematical expression for the first n numbers
- C Program to Calculate the price of movie tickets
- C Program to calculate the sum of elements of upper triangle of a n*n matrix using DMA
- C Program to accept n numbers from user store these numbers into an array & calculate average of n numbers
- Calculate sum of element of upper triangle of m*n matrix by using dynamic memory allocation
- Calculate sum of non-diagonal element in m*n matrix C Program
- Accept n number from user, store these number into an array and calculate the average of n number
- Calculate sum of element of lower triangle of m*n matrix by using dynamic memory allocation
Result
- C Program to find result where value and power are user given
- C program that receives 10 float numbers from the console and sort them in non-ascending order, and prints the result
- C Program to accept n numbers & store all prime numbers in an array & display this result
- C Program to accept a string from user, delete all vowels from that string & display the result
Store
- C Program To Store Students Record In A Text File
- C Program To Store Students Record Using Structure
- C program calculates a given function in range given by user, stores the data in arrays and displays the answer in a table.
- C Program to accept n numbers from user store these numbers into an array & calculate average of n numbers
- C Program to accept n numbers & store all prime numbers in an array & display this result
- C program to accept n number from user,store these numbers into an array & count the no of occurrences of each number
- C Program to accept n numbers from user store these numbers into an array & reverse an array elements using function
- C Program to accept 5 names from user & store these names into an array. Sort these array elements in alphabetical order
- C Program to accept n numbers from user,store these numbers into an array & sort the number of an array
- C Program to accept n numbers from user, store these numbers into an array. Find out Maximum & Minimum number from an Array
- C Program to accept data from user store that data into text file
- Find the union and intersection of two sets of integer store it in two array C Program
- Accept n number from user, store these number into an array and calculate the average of n number
- C Program - Hash Table to store information about a student
- C Program to Input Student Details into a File For Two Subjects
Matrix
- C Program To Find Transpose Of A Matrix
- C Program To Multiply Two Matrices
- C Program To Print Tridiagonal Matrix
- C Program To Understand Use Of Pointers In MATRIX
- C Program : 4x4 Matrix Keypad connected to Arduino. This code prints the key pressed on the keypad to the serial port.
- C Code/Program For Swap Matrix
- matrix sort in C Program
- Sequential Matrix Multiplication C Program
- C Program to accept m*n matrix from user and display the elements of given matrix using function
- C Program to calculate the sum of elements of upper triangle of a n*n matrix using DMA
- C program to display the transpose of given 3 X 3 matrix
- Calculate sum of element of upper triangle of m*n matrix by using dynamic memory allocation
- Calculate sum of non-diagonal element in m*n matrix C Program
- Calculate sum of element of lower triangle of m*n matrix by using dynamic memory allocation
- C Program Shortest Distance in Matrix
- C Program To Read The Adjecancy Matrix of Directed Graph And Convert It Into Adjecancy List