SlideShare a Scribd company logo
1 of 2
This program let you to add two matrices of same size and
displaying the elements of resultant matrix.
void main()
{
int a[2][2], b[2][2], c[2][2];
printf("enter the elements of matrix an");
for(i=0 ; i<=1 ; i++)
{
for(j=0 ; j<=1 ; j++)
{
scanf("%d",&a[i][j]);
}
}
printf("enter the elements of matrix bn");
for(i=0 ; i<=1 ; i++)
{
for(j=0 ; j<=1 ; j++)
{
scanf("%d",&b[i][j]);
}
}
printf("the sum of two matrices is n");
for(i=0 ; i<=1 ; i++)
{
for(j=0 ; j<=1 ; j++)
{
printf("%dn",a[i][j] + b[i][j]);
}
}
}
output
enter the elements of matrix a
1
2
3
4
enter the elements of matrix b
1
2
3
4
the sum of two matrices is
2
4
6
8

More Related Content

What's hot

Programming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiProgramming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiPriya Chauhan
 
Java buzzwords
Java buzzwordsJava buzzwords
Java buzzwordsramesh517
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File Rahul Chugh
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : ArraysGagan Deep
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: MethodsSvetlin Nakov
 
Data types in python
Data types in pythonData types in python
Data types in pythonRaginiJain21
 
Inline function in C++
Inline function in C++Inline function in C++
Inline function in C++Jenish Patel
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners Sujith Kumar
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayimtiazalijoono
 
Tree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal KhanTree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal KhanDaniyal Khan
 
Java Methods
Java MethodsJava Methods
Java MethodsOXUS 20
 

What's hot (20)

Methods in Java
Methods in JavaMethods in Java
Methods in Java
 
Constructor ppt
Constructor pptConstructor ppt
Constructor ppt
 
Programming in ansi C by Balaguruswami
Programming in ansi C by BalaguruswamiProgramming in ansi C by Balaguruswami
Programming in ansi C by Balaguruswami
 
Java buzzwords
Java buzzwordsJava buzzwords
Java buzzwords
 
Inheritance in Java
Inheritance in JavaInheritance in Java
Inheritance in Java
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File
 
Fcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt ChartFcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt Chart
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
C Programming : Arrays
C Programming : ArraysC Programming : Arrays
C Programming : Arrays
 
SQLite - Overview
SQLite - OverviewSQLite - Overview
SQLite - Overview
 
Java Foundations: Methods
Java Foundations: MethodsJava Foundations: Methods
Java Foundations: Methods
 
Tic tac toe game code
Tic tac toe game codeTic tac toe game code
Tic tac toe game code
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Inline function in C++
Inline function in C++Inline function in C++
Inline function in C++
 
inheritance
inheritanceinheritance
inheritance
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
Ansi c
Ansi cAnsi c
Ansi c
 
Tree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal KhanTree Data Structure by Daniyal Khan
Tree Data Structure by Daniyal Khan
 
Java Methods
Java MethodsJava Methods
Java Methods
 

Viewers also liked

Power Point
Power PointPower Point
Power Pointlucy_98
 
Tomassini Style - Luxury Van
Tomassini Style - Luxury VanTomassini Style - Luxury Van
Tomassini Style - Luxury VanTomassiniStyle
 
De Nador a Vic
De Nador a VicDe Nador a Vic
De Nador a VicPau4444
 
Bienban hopnhom
Bienban hopnhomBienban hopnhom
Bienban hopnhomhuyrua2112
 
103土石流潛勢溪流ev
103土石流潛勢溪流ev103土石流潛勢溪流ev
103土石流潛勢溪流evMark Wu
 
Colegio militar eloy alfaro
Colegio militar eloy alfaroColegio militar eloy alfaro
Colegio militar eloy alfarodianacarodbs
 
Los supercampeones.pptx. horacio german garcia
Los supercampeones.pptx. horacio german garciaLos supercampeones.pptx. horacio german garcia
Los supercampeones.pptx. horacio german garciaRobertoOtazu
 
Esquí alpino paralímpico.pptx. horacio german garcia
Esquí alpino paralímpico.pptx. horacio german garciaEsquí alpino paralímpico.pptx. horacio german garcia
Esquí alpino paralímpico.pptx. horacio german garciaRobertoOtazu
 
Thabalho de talles
Thabalho de tallesThabalho de talles
Thabalho de talleshld13
 
7 c gonçalo e denilsa visita de estudo
7 c gonçalo e denilsa visita de estudo7 c gonçalo e denilsa visita de estudo
7 c gonçalo e denilsa visita de estudoanabelaac
 
Institución educativa técnica de pasacaballos
Institución educativa técnica de pasacaballosInstitución educativa técnica de pasacaballos
Institución educativa técnica de pasacaballosNanis Arteaga
 
Limites infinitos y limites en el infinito
Limites infinitos y limites en el infinitoLimites infinitos y limites en el infinito
Limites infinitos y limites en el infinitoAngel E. RamOx
 
Teoría de progación errores
Teoría de progación erroresTeoría de progación errores
Teoría de progación erroresAlexis Tejedor
 

Viewers also liked (20)

Power Point
Power PointPower Point
Power Point
 
Tomassini Style - Luxury Van
Tomassini Style - Luxury VanTomassini Style - Luxury Van
Tomassini Style - Luxury Van
 
De Nador a Vic
De Nador a VicDe Nador a Vic
De Nador a Vic
 
Alicia patapam1
Alicia patapam1Alicia patapam1
Alicia patapam1
 
Matriz del marco logico
Matriz del marco logicoMatriz del marco logico
Matriz del marco logico
 
Presentación1kathe
Presentación1kathePresentación1kathe
Presentación1kathe
 
Bienban hopnhom
Bienban hopnhomBienban hopnhom
Bienban hopnhom
 
103土石流潛勢溪流ev
103土石流潛勢溪流ev103土石流潛勢溪流ev
103土石流潛勢溪流ev
 
Colegio militar eloy alfaro
Colegio militar eloy alfaroColegio militar eloy alfaro
Colegio militar eloy alfaro
 
Taller uno
Taller unoTaller uno
Taller uno
 
Los supercampeones.pptx. horacio german garcia
Los supercampeones.pptx. horacio german garciaLos supercampeones.pptx. horacio german garcia
Los supercampeones.pptx. horacio german garcia
 
Energy spain
Energy spainEnergy spain
Energy spain
 
Esquí alpino paralímpico.pptx. horacio german garcia
Esquí alpino paralímpico.pptx. horacio german garciaEsquí alpino paralímpico.pptx. horacio german garcia
Esquí alpino paralímpico.pptx. horacio german garcia
 
Soportech s.a.s
Soportech s.a.sSoportech s.a.s
Soportech s.a.s
 
Codelco
CodelcoCodelco
Codelco
 
Thabalho de talles
Thabalho de tallesThabalho de talles
Thabalho de talles
 
7 c gonçalo e denilsa visita de estudo
7 c gonçalo e denilsa visita de estudo7 c gonçalo e denilsa visita de estudo
7 c gonçalo e denilsa visita de estudo
 
Institución educativa técnica de pasacaballos
Institución educativa técnica de pasacaballosInstitución educativa técnica de pasacaballos
Institución educativa técnica de pasacaballos
 
Limites infinitos y limites en el infinito
Limites infinitos y limites en el infinitoLimites infinitos y limites en el infinito
Limites infinitos y limites en el infinito
 
Teoría de progación errores
Teoría de progación erroresTeoría de progación errores
Teoría de progación errores
 

Recently uploaded

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

addition of two matrices

  • 1. This program let you to add two matrices of same size and displaying the elements of resultant matrix. void main() { int a[2][2], b[2][2], c[2][2]; printf("enter the elements of matrix an"); for(i=0 ; i<=1 ; i++) { for(j=0 ; j<=1 ; j++) { scanf("%d",&a[i][j]); } } printf("enter the elements of matrix bn"); for(i=0 ; i<=1 ; i++) { for(j=0 ; j<=1 ; j++) { scanf("%d",&b[i][j]); } } printf("the sum of two matrices is n"); for(i=0 ; i<=1 ; i++) { for(j=0 ; j<=1 ; j++) { printf("%dn",a[i][j] + b[i][j]); } } } output enter the elements of matrix a 1 2 3 4 enter the elements of matrix b
  • 2. 1 2 3 4 the sum of two matrices is 2 4 6 8