SlideShare a Scribd company logo
1 of 7
Download to read offline
C-Programming
Walchand Institute of Technology (RC1131), Solapur Page 1
Handout#9
Assignment/ Program Statement:
Write a C program using a multidimensional (2D) array - to add two matrixes.
Learning Objectives:
Students will be able to
- declare the multidimensional (2D) array
- draw the flowchart for solution of the problem statement using
multidimensional (2D) array
- write the algorithm for the problem statement using multidimensional (2D)
array
- write the program using multidimensional (2D) array
Theory:
 C programming language allows multidimensional arrays. Here is the
general form of a multidimensional array declaration-
type name[size1][size2]...[sizeN];
For example, the following declaration creates a three dimensional integer
array −
int threedim[5][10][4];
 Two-dimensional Arrays
The simplest form of multidimensional array is the two-dimensional array. A
two-dimensional array is, in essence, a list of one-dimensional arrays. To
declare a two-dimensional integer array of size [x][y], you would write
something as follows −
type arrayName [ x ][ y ];
Where type can be any valid C data type and arrayName will be a valid C
identifier. A two-dimensional array can be considered as a table which will
have x number of rows and y number of columns. A two-dimensional array
a, which contains three rows and four columns can be shown as follows –
C-Programming
Walchand Institute of Technology (RC1131), Solapur Page 2
Thus, every element in the array a is identified by an element name of the
forma[ i ][ j ], where 'a' is the name of the array, and 'i' and 'j' are the
subscripts that uniquely identify each element in 'a'.
 Initializing Two-Dimensional Arrays
Multidimensional arrays may be initialized by specifying bracketed values
for each row. Following is an array with 3 rows and each row has 4 columns.
int a[3][4] = {
{0, 1, 2, 3} , /* initializers for row indexed by 0 */
{4, 5, 6, 7} , /* initializers for row indexed by 1 */
{8, 9, 10, 11}/* initializers for row indexed by 2 */
};
The nested braces, which indicate the intended row, are optional. The
following initialization is equivalent to the previous example −
int a[3][4] = {0,1,2,3,4,5,6,7,8,9,10,11};
[Reference: http://www.tutorialspoint.com/cprogramming/c_multi_dimensional_arrays.htm ]
C-Programming
Walchand Institute of Technology (RC1131), Solapur Page 3
Flowchart for Problem Statement:
C-Programming
Walchand Institute of Technology (RC1131), Solapur Page 4
Algorithm:
1. Start
2. Read the elements of first matrix
3. i=0, j=0
4. if i<2
a. if j<2
read first matrix a[i,j] element
j=j+1
got to step 4a
else
i=i+1
go to step 4
else
go to step 5
5. Read the elements of second matrix
6. if i<2
a. if j<2
read second matrix b[i,j] element
j=j+1
got to step 6a
else
i=i+1
go to step 6
else
go to step 7
7. if i<2
a. if j<2
c[i][j]=a[i][j]+b[i][j];
j=j+1
got to step 7a
else
i=i+1
go to step 7
else
go to step 8
C-Programming
Walchand Institute of Technology (RC1131), Solapur Page 5
8. Display sum of matrix
9. if i<2
a. if j<2
display matrix element c[i,j]
j=j+1
got to step 9a
else
i=i+1
go to step 9
else
go to step 10
10.Stop
Program:
#include <stdio.h>
int main()
{
float a[2][2], b[2][2], c[2][2];
int i,j;
printf("Enter the elements of 1st matrixn");
for(i=0;i<2;++i)
for(j=0;j<2;++j)
{
printf("Enter a%d%d: ",i+1,j+1);
scanf("%f",&a[i][j]);
}
printf("Enter the elements of 2nd matrixn");
for(i=0;i<2;++i)
for(j=0;j<2;++j)
{
printf("Enter b%d%d: ",i+1,j+1);
scanf("%f",&b[i][j]);
}
for(i=0;i<2;++i)
C-Programming
Walchand Institute of Technology (RC1131), Solapur Page 6
for(j=0;j<2;++j)
{
c[i][j]=a[i][j]+b[i][j];
}
printf("nSum Of Matrix:");
for(i=0;i<2;++i)
for(j=0;j<2;++j)
{
printf("%.1ft",c[i][j]);
if(j==1) /* To display matrix sum in order. */
printf("n");
}
return 0;
}
Input:
Enter the elements of 1st matrix
Enter a11: 2;
Enter a12: 2;
Enter a21: 1;
Enter a22: 3;
Enter the elements of 2nd matrix
Enter b11: 1;
Enter b12: 2;
Enter b21: 3;
Enter b22: 4;
Output:
Sum of Matrix:
3 4
4 7
Practice Problem Statement:
1. Write a program to find the transpose of a matrix
C-Programming
Walchand Institute of Technology (RC1131), Solapur Page 7
2. Write a program to multiply the matrix
Conclusion:
Thus a C program using a multidimensional array - to add two matrixes is
implemented.
Learning Outcomes:
At the end of this assignment, students are able to
- declare the multidimensional array.
- draw the flowchart for solution of the problem statement using
multidimensional array.
- write the algorithm for the problem statement using multidimensional array
- write the program using multidimensional array.

More Related Content

What's hot (20)

CP Handout#4
CP Handout#4CP Handout#4
CP Handout#4
 
Ocs752 unit 2
Ocs752   unit 2Ocs752   unit 2
Ocs752 unit 2
 
C programming(Part 1)
C programming(Part 1)C programming(Part 1)
C programming(Part 1)
 
Ocs752 unit 1
Ocs752   unit 1Ocs752   unit 1
Ocs752 unit 1
 
Ocs752 unit 3
Ocs752   unit 3Ocs752   unit 3
Ocs752 unit 3
 
Ocs752 unit 4
Ocs752   unit 4Ocs752   unit 4
Ocs752 unit 4
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)
 
Ocs752 unit 5
Ocs752   unit 5Ocs752   unit 5
Ocs752 unit 5
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
C programming session 02
C programming session 02C programming session 02
C programming session 02
 
Assignment8
Assignment8Assignment8
Assignment8
 
Unit i intro-operators
Unit   i intro-operatorsUnit   i intro-operators
Unit i intro-operators
 
C programming(part 3)
C programming(part 3)C programming(part 3)
C programming(part 3)
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
 
Assignment12
Assignment12Assignment12
Assignment12
 
C Programming
C ProgrammingC Programming
C Programming
 
2. introduction of a c program
2. introduction of a c program2. introduction of a c program
2. introduction of a c program
 
Assignment9
Assignment9Assignment9
Assignment9
 
C fundamentals
C fundamentalsC fundamentals
C fundamentals
 
Assignment7
Assignment7Assignment7
Assignment7
 

Similar to CP Handout#9 (20)

Array,MULTI ARRAY, IN C
Array,MULTI ARRAY, IN CArray,MULTI ARRAY, IN C
Array,MULTI ARRAY, IN C
 
Array
ArrayArray
Array
 
Unit 3
Unit 3 Unit 3
Unit 3
 
Arrays in C language
Arrays in C languageArrays in C language
Arrays in C language
 
CS.3.Arrays.pdf
CS.3.Arrays.pdfCS.3.Arrays.pdf
CS.3.Arrays.pdf
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
2D-Array
2D-Array 2D-Array
2D-Array
 
Fp201 unit4
Fp201 unit4Fp201 unit4
Fp201 unit4
 
Arrays
ArraysArrays
Arrays
 
C Arrays.ppt
C Arrays.pptC Arrays.ppt
C Arrays.ppt
 
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
 
Array 31.8.2020 updated
Array 31.8.2020 updatedArray 31.8.2020 updated
Array 31.8.2020 updated
 
Arrays and library functions
Arrays and library functionsArrays and library functions
Arrays and library functions
 
ARRAYS
ARRAYSARRAYS
ARRAYS
 
Java Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdfJava Question-Bank-Class-8.pdf
Java Question-Bank-Class-8.pdf
 
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
 
Ansi c
Ansi cAnsi c
Ansi c
 
Unit 3
Unit 3 Unit 3
Unit 3
 
VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2
 

More from trupti1976

MobileAppDev Handout#3
MobileAppDev Handout#3MobileAppDev Handout#3
MobileAppDev Handout#3trupti1976
 
MobileAppDev Handout#10
MobileAppDev Handout#10MobileAppDev Handout#10
MobileAppDev Handout#10trupti1976
 
MobileAppDev Handout#9
MobileAppDev Handout#9MobileAppDev Handout#9
MobileAppDev Handout#9trupti1976
 
MobileAppDev Handout#8
MobileAppDev Handout#8MobileAppDev Handout#8
MobileAppDev Handout#8trupti1976
 
MobileAppDev Handout#7
MobileAppDev Handout#7MobileAppDev Handout#7
MobileAppDev Handout#7trupti1976
 
MobileAppDev Handout#6
MobileAppDev Handout#6MobileAppDev Handout#6
MobileAppDev Handout#6trupti1976
 
MobileAppDev Handout#5
MobileAppDev Handout#5MobileAppDev Handout#5
MobileAppDev Handout#5trupti1976
 
MobileAppDev Handout#4
MobileAppDev Handout#4MobileAppDev Handout#4
MobileAppDev Handout#4trupti1976
 
MobileAppDev Handout#2
MobileAppDev Handout#2MobileAppDev Handout#2
MobileAppDev Handout#2trupti1976
 
MobileAppDev Handout#1
MobileAppDev Handout#1MobileAppDev Handout#1
MobileAppDev Handout#1trupti1976
 

More from trupti1976 (10)

MobileAppDev Handout#3
MobileAppDev Handout#3MobileAppDev Handout#3
MobileAppDev Handout#3
 
MobileAppDev Handout#10
MobileAppDev Handout#10MobileAppDev Handout#10
MobileAppDev Handout#10
 
MobileAppDev Handout#9
MobileAppDev Handout#9MobileAppDev Handout#9
MobileAppDev Handout#9
 
MobileAppDev Handout#8
MobileAppDev Handout#8MobileAppDev Handout#8
MobileAppDev Handout#8
 
MobileAppDev Handout#7
MobileAppDev Handout#7MobileAppDev Handout#7
MobileAppDev Handout#7
 
MobileAppDev Handout#6
MobileAppDev Handout#6MobileAppDev Handout#6
MobileAppDev Handout#6
 
MobileAppDev Handout#5
MobileAppDev Handout#5MobileAppDev Handout#5
MobileAppDev Handout#5
 
MobileAppDev Handout#4
MobileAppDev Handout#4MobileAppDev Handout#4
MobileAppDev Handout#4
 
MobileAppDev Handout#2
MobileAppDev Handout#2MobileAppDev Handout#2
MobileAppDev Handout#2
 
MobileAppDev Handout#1
MobileAppDev Handout#1MobileAppDev Handout#1
MobileAppDev Handout#1
 

Recently uploaded

Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementDr. Deepak Mudgal
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxMustafa Ahmed
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesChandrakantDivate1
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesRashidFaridChishti
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...ppkakm
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information SystemsAnge Felix NSANZIYERA
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...josephjonse
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessorAshwiniTodkar4
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptAfnanAhmad53
 

Recently uploaded (20)

Ground Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth ReinforcementGround Improvement Technique: Earth Reinforcement
Ground Improvement Technique: Earth Reinforcement
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Introduction to Geographic Information Systems
Introduction to Geographic Information SystemsIntroduction to Geographic Information Systems
Introduction to Geographic Information Systems
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...8th International Conference on Soft Computing, Mathematics and Control (SMC ...
8th International Conference on Soft Computing, Mathematics and Control (SMC ...
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 

CP Handout#9

  • 1. C-Programming Walchand Institute of Technology (RC1131), Solapur Page 1 Handout#9 Assignment/ Program Statement: Write a C program using a multidimensional (2D) array - to add two matrixes. Learning Objectives: Students will be able to - declare the multidimensional (2D) array - draw the flowchart for solution of the problem statement using multidimensional (2D) array - write the algorithm for the problem statement using multidimensional (2D) array - write the program using multidimensional (2D) array Theory:  C programming language allows multidimensional arrays. Here is the general form of a multidimensional array declaration- type name[size1][size2]...[sizeN]; For example, the following declaration creates a three dimensional integer array − int threedim[5][10][4];  Two-dimensional Arrays The simplest form of multidimensional array is the two-dimensional array. A two-dimensional array is, in essence, a list of one-dimensional arrays. To declare a two-dimensional integer array of size [x][y], you would write something as follows − type arrayName [ x ][ y ]; Where type can be any valid C data type and arrayName will be a valid C identifier. A two-dimensional array can be considered as a table which will have x number of rows and y number of columns. A two-dimensional array a, which contains three rows and four columns can be shown as follows –
  • 2. C-Programming Walchand Institute of Technology (RC1131), Solapur Page 2 Thus, every element in the array a is identified by an element name of the forma[ i ][ j ], where 'a' is the name of the array, and 'i' and 'j' are the subscripts that uniquely identify each element in 'a'.  Initializing Two-Dimensional Arrays Multidimensional arrays may be initialized by specifying bracketed values for each row. Following is an array with 3 rows and each row has 4 columns. int a[3][4] = { {0, 1, 2, 3} , /* initializers for row indexed by 0 */ {4, 5, 6, 7} , /* initializers for row indexed by 1 */ {8, 9, 10, 11}/* initializers for row indexed by 2 */ }; The nested braces, which indicate the intended row, are optional. The following initialization is equivalent to the previous example − int a[3][4] = {0,1,2,3,4,5,6,7,8,9,10,11}; [Reference: http://www.tutorialspoint.com/cprogramming/c_multi_dimensional_arrays.htm ]
  • 3. C-Programming Walchand Institute of Technology (RC1131), Solapur Page 3 Flowchart for Problem Statement:
  • 4. C-Programming Walchand Institute of Technology (RC1131), Solapur Page 4 Algorithm: 1. Start 2. Read the elements of first matrix 3. i=0, j=0 4. if i<2 a. if j<2 read first matrix a[i,j] element j=j+1 got to step 4a else i=i+1 go to step 4 else go to step 5 5. Read the elements of second matrix 6. if i<2 a. if j<2 read second matrix b[i,j] element j=j+1 got to step 6a else i=i+1 go to step 6 else go to step 7 7. if i<2 a. if j<2 c[i][j]=a[i][j]+b[i][j]; j=j+1 got to step 7a else i=i+1 go to step 7 else go to step 8
  • 5. C-Programming Walchand Institute of Technology (RC1131), Solapur Page 5 8. Display sum of matrix 9. if i<2 a. if j<2 display matrix element c[i,j] j=j+1 got to step 9a else i=i+1 go to step 9 else go to step 10 10.Stop Program: #include <stdio.h> int main() { float a[2][2], b[2][2], c[2][2]; int i,j; printf("Enter the elements of 1st matrixn"); for(i=0;i<2;++i) for(j=0;j<2;++j) { printf("Enter a%d%d: ",i+1,j+1); scanf("%f",&a[i][j]); } printf("Enter the elements of 2nd matrixn"); for(i=0;i<2;++i) for(j=0;j<2;++j) { printf("Enter b%d%d: ",i+1,j+1); scanf("%f",&b[i][j]); } for(i=0;i<2;++i)
  • 6. C-Programming Walchand Institute of Technology (RC1131), Solapur Page 6 for(j=0;j<2;++j) { c[i][j]=a[i][j]+b[i][j]; } printf("nSum Of Matrix:"); for(i=0;i<2;++i) for(j=0;j<2;++j) { printf("%.1ft",c[i][j]); if(j==1) /* To display matrix sum in order. */ printf("n"); } return 0; } Input: Enter the elements of 1st matrix Enter a11: 2; Enter a12: 2; Enter a21: 1; Enter a22: 3; Enter the elements of 2nd matrix Enter b11: 1; Enter b12: 2; Enter b21: 3; Enter b22: 4; Output: Sum of Matrix: 3 4 4 7 Practice Problem Statement: 1. Write a program to find the transpose of a matrix
  • 7. C-Programming Walchand Institute of Technology (RC1131), Solapur Page 7 2. Write a program to multiply the matrix Conclusion: Thus a C program using a multidimensional array - to add two matrixes is implemented. Learning Outcomes: At the end of this assignment, students are able to - declare the multidimensional array. - draw the flowchart for solution of the problem statement using multidimensional array. - write the algorithm for the problem statement using multidimensional array - write the program using multidimensional array.