SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
import java.util.Scanner; class AddTwoMatrix { public static void main(String args[]) {
int m, n, c, d; Scanner in = new Scanner(System.in); System.out.println("Enter the
number of rows and columns of matrix"); m = in.nextInt(); n = in.nextInt(); int
first[][] = new int[m][n]; int second[][] = new int[m][n]; int sum[][] = new int[m][n];
System.out.println("Enter the elements of first matrix"); for ( c = 0 ; c < m ; c++ )
for ( d = 0 ; d < n ; d++ ) first[c][d] = in.nextInt(); System.out.println("Enter the
elements of second matrix"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ )
second[c][d] = in.nextInt(); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ )
sum[c][d] = first[c][d] + second[c][d]; //replace '+' with '-' to subtract matrices
System.out.println("Sum of entered matrices:-"); for ( c = 0 ; c < m ; c++ ) { for (
d = 0 ; d < n ; d++ ) System.out.print(sum[c][d]+"t"); System.out.println(); }
} }
Solution
import java.util.Scanner; class AddTwoMatrix { public static void main(String args[]) {
int m, n, c, d; Scanner in = new Scanner(System.in); System.out.println("Enter the
number of rows and columns of matrix"); m = in.nextInt(); n = in.nextInt(); int
first[][] = new int[m][n]; int second[][] = new int[m][n]; int sum[][] = new int[m][n];
System.out.println("Enter the elements of first matrix"); for ( c = 0 ; c < m ; c++ )
for ( d = 0 ; d < n ; d++ ) first[c][d] = in.nextInt(); System.out.println("Enter the
elements of second matrix"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ )
second[c][d] = in.nextInt(); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ )
sum[c][d] = first[c][d] + second[c][d]; //replace '+' with '-' to subtract matrices
System.out.println("Sum of entered matrices:-"); for ( c = 0 ; c < m ; c++ ) { for (
d = 0 ; d < n ; d++ ) System.out.print(sum[c][d]+"t"); System.out.println(); }
} }

Más contenido relacionado

Similar a import java.util.Scanner; class AddTwoMatrix { public static vo.pdf

JAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfJAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfRohitkumarYadav80
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptxKimVeeL
 
import java.util.Scanner;public class ArrayOperation {    inp.pdf
import java.util.Scanner;public class ArrayOperation {     inp.pdfimport java.util.Scanner;public class ArrayOperation {     inp.pdf
import java.util.Scanner;public class ArrayOperation {    inp.pdfangelsfashion1
 
Java AssignmentWrite a program using sortingsorting bubble,sele.pdf
Java AssignmentWrite a program using sortingsorting bubble,sele.pdfJava AssignmentWrite a program using sortingsorting bubble,sele.pdf
Java AssignmentWrite a program using sortingsorting bubble,sele.pdfeyewatchsystems
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdfanupamfootwear
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docxKatecate1
 
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...Nithin Kumar,VVCE, Mysuru
 
import java.util.; public class ClientMerge_2 {     static Scan.pdf
import java.util.; public class ClientMerge_2 {     static Scan.pdfimport java.util.; public class ClientMerge_2 {     static Scan.pdf
import java.util.; public class ClientMerge_2 {     static Scan.pdfpremkhatri99
 
Java Assignment.Implement a binary search algorithm on an array..pdf
Java Assignment.Implement a binary search algorithm on an array..pdfJava Assignment.Implement a binary search algorithm on an array..pdf
Java Assignment.Implement a binary search algorithm on an array..pdfirshadoptical
 
Cse 121 presentation on matrix [autosaved]
Cse 121 presentation on matrix [autosaved]Cse 121 presentation on matrix [autosaved]
Cse 121 presentation on matrix [autosaved]Kanis Fatema Shanta
 
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdfAnkitchhabra28
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iiiNiraj Bharambe
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2Ankit Gupta
 
Computer java programs
Computer java programsComputer java programs
Computer java programsADITYA BHARTI
 

Similar a import java.util.Scanner; class AddTwoMatrix { public static vo.pdf (20)

JAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdfJAVA PRACTICE QUESTIONS v1.4.pdf
JAVA PRACTICE QUESTIONS v1.4.pdf
 
Lab01.pptx
Lab01.pptxLab01.pptx
Lab01.pptx
 
import java.util.Scanner;public class ArrayOperation {    inp.pdf
import java.util.Scanner;public class ArrayOperation {     inp.pdfimport java.util.Scanner;public class ArrayOperation {     inp.pdf
import java.util.Scanner;public class ArrayOperation {    inp.pdf
 
Oot practical
Oot practicalOot practical
Oot practical
 
Java AssignmentWrite a program using sortingsorting bubble,sele.pdf
Java AssignmentWrite a program using sortingsorting bubble,sele.pdfJava AssignmentWrite a program using sortingsorting bubble,sele.pdf
Java AssignmentWrite a program using sortingsorting bubble,sele.pdf
 
Ann
AnnAnn
Ann
 
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 Problem1 java codeimport java.util.Scanner; Java code to pr.pdf Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
Problem1 java codeimport java.util.Scanner; Java code to pr.pdf
 
.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
 
import java.uti-WPS Office.docx
import java.uti-WPS Office.docximport java.uti-WPS Office.docx
import java.uti-WPS Office.docx
 
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
 
C++ ARRAY WITH EXAMPLES
C++ ARRAY WITH EXAMPLESC++ ARRAY WITH EXAMPLES
C++ ARRAY WITH EXAMPLES
 
import java.util.; public class ClientMerge_2 {     static Scan.pdf
import java.util.; public class ClientMerge_2 {     static Scan.pdfimport java.util.; public class ClientMerge_2 {     static Scan.pdf
import java.util.; public class ClientMerge_2 {     static Scan.pdf
 
Java Assignment.Implement a binary search algorithm on an array..pdf
Java Assignment.Implement a binary search algorithm on an array..pdfJava Assignment.Implement a binary search algorithm on an array..pdf
Java Assignment.Implement a binary search algorithm on an array..pdf
 
Cse 121 presentation on matrix [autosaved]
Cse 121 presentation on matrix [autosaved]Cse 121 presentation on matrix [autosaved]
Cse 121 presentation on matrix [autosaved]
 
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf1. import java.util.Scanner; public class Alphabetical_Order {.pdf
1. import java.util.Scanner; public class Alphabetical_Order {.pdf
 
Core java pract_sem iii
Core java pract_sem iiiCore java pract_sem iii
Core java pract_sem iii
 
Two methods.pdf
Two methods.pdfTwo methods.pdf
Two methods.pdf
 
java program assigment -2
java program assigment -2java program assigment -2
java program assigment -2
 
JAVA.pdf
JAVA.pdfJAVA.pdf
JAVA.pdf
 
Computer java programs
Computer java programsComputer java programs
Computer java programs
 

Más de angeldresses

oxidizing agent F2 I2 Fe2+ Li+ reducing ag.pdf
                     oxidizing agent F2  I2  Fe2+  Li+ reducing ag.pdf                     oxidizing agent F2  I2  Fe2+  Li+ reducing ag.pdf
oxidizing agent F2 I2 Fe2+ Li+ reducing ag.pdfangeldresses
 
Lewis Base is a substance that can gain electron .pdf
                     Lewis Base is a substance that can gain electron .pdf                     Lewis Base is a substance that can gain electron .pdf
Lewis Base is a substance that can gain electron .pdfangeldresses
 
let 3x mole of Fe react then moles of H2O is 4x m.pdf
                     let 3x mole of Fe react then moles of H2O is 4x m.pdf                     let 3x mole of Fe react then moles of H2O is 4x m.pdf
let 3x mole of Fe react then moles of H2O is 4x m.pdfangeldresses
 
X is a vector space but has no basis.SolutionX is a vector spa.pdf
X is a vector space but has no basis.SolutionX is a vector spa.pdfX is a vector space but has no basis.SolutionX is a vector spa.pdf
X is a vector space but has no basis.SolutionX is a vector spa.pdfangeldresses
 
Usually NGS (Next generation sequencing) is extensively used in unde.pdf
Usually NGS (Next generation sequencing) is extensively used in unde.pdfUsually NGS (Next generation sequencing) is extensively used in unde.pdf
Usually NGS (Next generation sequencing) is extensively used in unde.pdfangeldresses
 
There are 15 members of the show choir. In how many ways can you arr.pdf
There are 15 members of the show choir. In how many ways can you arr.pdfThere are 15 members of the show choir. In how many ways can you arr.pdf
There are 15 members of the show choir. In how many ways can you arr.pdfangeldresses
 
The Hubble Space Telescope (HST) is a space telescope that was carri.pdf
The Hubble Space Telescope (HST) is a space telescope that was carri.pdfThe Hubble Space Telescope (HST) is a space telescope that was carri.pdf
The Hubble Space Telescope (HST) is a space telescope that was carri.pdfangeldresses
 
IBrClF Solution IBr.pdf
                     IBrClF  Solution                     IBr.pdf                     IBrClF  Solution                     IBr.pdf
IBrClF Solution IBr.pdfangeldresses
 
hexacyanoferrate(III) because the given radical i.pdf
                     hexacyanoferrate(III) because the given radical i.pdf                     hexacyanoferrate(III) because the given radical i.pdf
hexacyanoferrate(III) because the given radical i.pdfangeldresses
 
The answer is e) they would get stuck in the membrane of the endopla.pdf
The answer is e) they would get stuck in the membrane of the endopla.pdfThe answer is e) they would get stuck in the membrane of the endopla.pdf
The answer is e) they would get stuck in the membrane of the endopla.pdfangeldresses
 
Step 1SolutionStep 1.pdf
Step 1SolutionStep 1.pdfStep 1SolutionStep 1.pdf
Step 1SolutionStep 1.pdfangeldresses
 
sorry bro...but where is section 5.2u might have missed postng th.pdf
sorry bro...but where is section 5.2u might have missed postng th.pdfsorry bro...but where is section 5.2u might have missed postng th.pdf
sorry bro...but where is section 5.2u might have missed postng th.pdfangeldresses
 
Pseudocode ExamplesChanged 15 December 1999A calculation is a st.pdf
Pseudocode ExamplesChanged 15 December 1999A calculation is a st.pdfPseudocode ExamplesChanged 15 December 1999A calculation is a st.pdf
Pseudocode ExamplesChanged 15 December 1999A calculation is a st.pdfangeldresses
 
Process of transmission between A node and B nodeThere are differ.pdf
Process of transmission between A node and B nodeThere are differ.pdfProcess of transmission between A node and B nodeThere are differ.pdf
Process of transmission between A node and B nodeThere are differ.pdfangeldresses
 
Halogenated waste note All halogen containing o.pdf
                     Halogenated waste  note All halogen containing o.pdf                     Halogenated waste  note All halogen containing o.pdf
Halogenated waste note All halogen containing o.pdfangeldresses
 
PbI2 is only very slightly soluble in water, so the following equili.pdf
PbI2 is only very slightly soluble in water, so the following equili.pdfPbI2 is only very slightly soluble in water, so the following equili.pdf
PbI2 is only very slightly soluble in water, so the following equili.pdfangeldresses
 
option D is correctA thermodynamic cycle starts with a system in a.pdf
option D is correctA thermodynamic cycle starts with a system in a.pdfoption D is correctA thermodynamic cycle starts with a system in a.pdf
option D is correctA thermodynamic cycle starts with a system in a.pdfangeldresses
 
Fluorescence return from excited singlet state to.pdf
                     Fluorescence return from excited singlet state to.pdf                     Fluorescence return from excited singlet state to.pdf
Fluorescence return from excited singlet state to.pdfangeldresses
 
EDTA has 4 carboxylic acid groups, so adding a lo.pdf
                     EDTA has 4 carboxylic acid groups, so adding a lo.pdf                     EDTA has 4 carboxylic acid groups, so adding a lo.pdf
EDTA has 4 carboxylic acid groups, so adding a lo.pdfangeldresses
 
Ion channels are the membrane proteins which have pores. They allow .pdf
Ion channels are the membrane proteins which have pores. They allow .pdfIon channels are the membrane proteins which have pores. They allow .pdf
Ion channels are the membrane proteins which have pores. They allow .pdfangeldresses
 

Más de angeldresses (20)

oxidizing agent F2 I2 Fe2+ Li+ reducing ag.pdf
                     oxidizing agent F2  I2  Fe2+  Li+ reducing ag.pdf                     oxidizing agent F2  I2  Fe2+  Li+ reducing ag.pdf
oxidizing agent F2 I2 Fe2+ Li+ reducing ag.pdf
 
Lewis Base is a substance that can gain electron .pdf
                     Lewis Base is a substance that can gain electron .pdf                     Lewis Base is a substance that can gain electron .pdf
Lewis Base is a substance that can gain electron .pdf
 
let 3x mole of Fe react then moles of H2O is 4x m.pdf
                     let 3x mole of Fe react then moles of H2O is 4x m.pdf                     let 3x mole of Fe react then moles of H2O is 4x m.pdf
let 3x mole of Fe react then moles of H2O is 4x m.pdf
 
X is a vector space but has no basis.SolutionX is a vector spa.pdf
X is a vector space but has no basis.SolutionX is a vector spa.pdfX is a vector space but has no basis.SolutionX is a vector spa.pdf
X is a vector space but has no basis.SolutionX is a vector spa.pdf
 
Usually NGS (Next generation sequencing) is extensively used in unde.pdf
Usually NGS (Next generation sequencing) is extensively used in unde.pdfUsually NGS (Next generation sequencing) is extensively used in unde.pdf
Usually NGS (Next generation sequencing) is extensively used in unde.pdf
 
There are 15 members of the show choir. In how many ways can you arr.pdf
There are 15 members of the show choir. In how many ways can you arr.pdfThere are 15 members of the show choir. In how many ways can you arr.pdf
There are 15 members of the show choir. In how many ways can you arr.pdf
 
The Hubble Space Telescope (HST) is a space telescope that was carri.pdf
The Hubble Space Telescope (HST) is a space telescope that was carri.pdfThe Hubble Space Telescope (HST) is a space telescope that was carri.pdf
The Hubble Space Telescope (HST) is a space telescope that was carri.pdf
 
IBrClF Solution IBr.pdf
                     IBrClF  Solution                     IBr.pdf                     IBrClF  Solution                     IBr.pdf
IBrClF Solution IBr.pdf
 
hexacyanoferrate(III) because the given radical i.pdf
                     hexacyanoferrate(III) because the given radical i.pdf                     hexacyanoferrate(III) because the given radical i.pdf
hexacyanoferrate(III) because the given radical i.pdf
 
The answer is e) they would get stuck in the membrane of the endopla.pdf
The answer is e) they would get stuck in the membrane of the endopla.pdfThe answer is e) they would get stuck in the membrane of the endopla.pdf
The answer is e) they would get stuck in the membrane of the endopla.pdf
 
Step 1SolutionStep 1.pdf
Step 1SolutionStep 1.pdfStep 1SolutionStep 1.pdf
Step 1SolutionStep 1.pdf
 
sorry bro...but where is section 5.2u might have missed postng th.pdf
sorry bro...but where is section 5.2u might have missed postng th.pdfsorry bro...but where is section 5.2u might have missed postng th.pdf
sorry bro...but where is section 5.2u might have missed postng th.pdf
 
Pseudocode ExamplesChanged 15 December 1999A calculation is a st.pdf
Pseudocode ExamplesChanged 15 December 1999A calculation is a st.pdfPseudocode ExamplesChanged 15 December 1999A calculation is a st.pdf
Pseudocode ExamplesChanged 15 December 1999A calculation is a st.pdf
 
Process of transmission between A node and B nodeThere are differ.pdf
Process of transmission between A node and B nodeThere are differ.pdfProcess of transmission between A node and B nodeThere are differ.pdf
Process of transmission between A node and B nodeThere are differ.pdf
 
Halogenated waste note All halogen containing o.pdf
                     Halogenated waste  note All halogen containing o.pdf                     Halogenated waste  note All halogen containing o.pdf
Halogenated waste note All halogen containing o.pdf
 
PbI2 is only very slightly soluble in water, so the following equili.pdf
PbI2 is only very slightly soluble in water, so the following equili.pdfPbI2 is only very slightly soluble in water, so the following equili.pdf
PbI2 is only very slightly soluble in water, so the following equili.pdf
 
option D is correctA thermodynamic cycle starts with a system in a.pdf
option D is correctA thermodynamic cycle starts with a system in a.pdfoption D is correctA thermodynamic cycle starts with a system in a.pdf
option D is correctA thermodynamic cycle starts with a system in a.pdf
 
Fluorescence return from excited singlet state to.pdf
                     Fluorescence return from excited singlet state to.pdf                     Fluorescence return from excited singlet state to.pdf
Fluorescence return from excited singlet state to.pdf
 
EDTA has 4 carboxylic acid groups, so adding a lo.pdf
                     EDTA has 4 carboxylic acid groups, so adding a lo.pdf                     EDTA has 4 carboxylic acid groups, so adding a lo.pdf
EDTA has 4 carboxylic acid groups, so adding a lo.pdf
 
Ion channels are the membrane proteins which have pores. They allow .pdf
Ion channels are the membrane proteins which have pores. They allow .pdfIon channels are the membrane proteins which have pores. They allow .pdf
Ion channels are the membrane proteins which have pores. They allow .pdf
 

Último

Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 

Último (20)

Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 

import java.util.Scanner; class AddTwoMatrix { public static vo.pdf

  • 1. import java.util.Scanner; class AddTwoMatrix { public static void main(String args[]) { int m, n, c, d; Scanner in = new Scanner(System.in); System.out.println("Enter the number of rows and columns of matrix"); m = in.nextInt(); n = in.nextInt(); int first[][] = new int[m][n]; int second[][] = new int[m][n]; int sum[][] = new int[m][n]; System.out.println("Enter the elements of first matrix"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) first[c][d] = in.nextInt(); System.out.println("Enter the elements of second matrix"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) second[c][d] = in.nextInt(); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) sum[c][d] = first[c][d] + second[c][d]; //replace '+' with '-' to subtract matrices System.out.println("Sum of entered matrices:-"); for ( c = 0 ; c < m ; c++ ) { for ( d = 0 ; d < n ; d++ ) System.out.print(sum[c][d]+"t"); System.out.println(); } } } Solution import java.util.Scanner; class AddTwoMatrix { public static void main(String args[]) { int m, n, c, d; Scanner in = new Scanner(System.in); System.out.println("Enter the number of rows and columns of matrix"); m = in.nextInt(); n = in.nextInt(); int first[][] = new int[m][n]; int second[][] = new int[m][n]; int sum[][] = new int[m][n]; System.out.println("Enter the elements of first matrix"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) first[c][d] = in.nextInt(); System.out.println("Enter the elements of second matrix"); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) second[c][d] = in.nextInt(); for ( c = 0 ; c < m ; c++ ) for ( d = 0 ; d < n ; d++ ) sum[c][d] = first[c][d] + second[c][d]; //replace '+' with '-' to subtract matrices System.out.println("Sum of entered matrices:-"); for ( c = 0 ; c < m ; c++ ) { for ( d = 0 ; d < n ; d++ ) System.out.print(sum[c][d]+"t"); System.out.println(); } } }