SlideShare a Scribd company logo
Use 2dimensional arrays to represent matrices
Solution
import java.util.*;
import java.lang.*;
import java.io.*;
class lab5c
{
public static void main (String[] args)
{
int[][] A = {{10,55,4,89,39},{45,9,49,98,23},{4,8,90,23,9},{8,37,80,2,31}};
int[][] B = {{40,1,16},{90,3,7},{9,2,22},{44,35,60},{18,67,21}};
int[][] C = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}};
int sum = 0;
for(int i=0;i<=4;i++)
{
sum = sum + A[2][i] * B[i][1];
System.out.println(sum);
}
C[2][1] = sum;
System.out.println("C[2][1] = "+C[2][1]);
}
}
output:

More Related Content

PDF
Need to revise working code below,A good design means the applicat.pdf
PDF
MolluscaIdentify the distinguishing characteristics of Phylum Moll.pdf
PDF
Match the directional term with its Correct ipsilateral media in.pdf
PDF
LithiumA. has a very narrow therapeutic range.B. completely cro.pdf
PDF
Let Z be the group of all integers under the operation of addition. E.pdf
PDF
In the United States today, nearly all of our electricity isproduc.pdf
PDF
In a radio link is required to send digital voice at 4800bps,but can.pdf
PDF
hi i have to write a java program involving link lists. i have a pro.pdf
Need to revise working code below,A good design means the applicat.pdf
MolluscaIdentify the distinguishing characteristics of Phylum Moll.pdf
Match the directional term with its Correct ipsilateral media in.pdf
LithiumA. has a very narrow therapeutic range.B. completely cro.pdf
Let Z be the group of all integers under the operation of addition. E.pdf
In the United States today, nearly all of our electricity isproduc.pdf
In a radio link is required to send digital voice at 4800bps,but can.pdf
hi i have to write a java program involving link lists. i have a pro.pdf

More from archgeetsenterprises (20)

PDF
Glial cells were originally thought to play a very minor role in the .pdf
PDF
Fungal reproductive cycle. Place the appropriate label in the correct.pdf
PDF
Explain the concept of distributive justiceSolutiondistributiv.pdf
PDF
Fecal-oral infections are often a result of _____ droplet transmissi.pdf
PDF
Dr. Z conducts a study examining the effect of socioeconomic status .pdf
PDF
Double branded DNA viruses (select only one answer) all insert their.pdf
PDF
Discuss the mechanisms by which antibiotic resistance genes can be h.pdf
PDF
Develop two biologically relevant and researchable questions comparin.pdf
PDF
Describe two methods for communicating the material in an Informatio.pdf
PDF
Describe the following structuresfunctions or cells Dermal, vascul.pdf
PDF
Describe the accounting and finance structure in an organization..pdf
PDF
Consider an assembly of thousands of people, all screaming, yelling,.pdf
PDF
Concrete and cementI) Give an example of non-calcium silicate cem.pdf
PDF
Compute the total interest and the monthly payments for an add-on i.pdf
PDF
Compare the views of Piaget and Vygotsky on school instruction in ab.pdf
PDF
Can molds be unicellular If so, in what conditions and under what c.pdf
PDF
Calculate the following cross exchange ratesThe dollar is trading.pdf
PDF
Bouchard Companys stock sells for $21 per share, its last dividen.pdf
PDF
Answer the following question please.The answers I have is wrong, .pdf
PDF
a) Research information about the U.S. Governments bailouts. Locat.pdf
Glial cells were originally thought to play a very minor role in the .pdf
Fungal reproductive cycle. Place the appropriate label in the correct.pdf
Explain the concept of distributive justiceSolutiondistributiv.pdf
Fecal-oral infections are often a result of _____ droplet transmissi.pdf
Dr. Z conducts a study examining the effect of socioeconomic status .pdf
Double branded DNA viruses (select only one answer) all insert their.pdf
Discuss the mechanisms by which antibiotic resistance genes can be h.pdf
Develop two biologically relevant and researchable questions comparin.pdf
Describe two methods for communicating the material in an Informatio.pdf
Describe the following structuresfunctions or cells Dermal, vascul.pdf
Describe the accounting and finance structure in an organization..pdf
Consider an assembly of thousands of people, all screaming, yelling,.pdf
Concrete and cementI) Give an example of non-calcium silicate cem.pdf
Compute the total interest and the monthly payments for an add-on i.pdf
Compare the views of Piaget and Vygotsky on school instruction in ab.pdf
Can molds be unicellular If so, in what conditions and under what c.pdf
Calculate the following cross exchange ratesThe dollar is trading.pdf
Bouchard Companys stock sells for $21 per share, its last dividen.pdf
Answer the following question please.The answers I have is wrong, .pdf
a) Research information about the U.S. Governments bailouts. Locat.pdf

Recently uploaded (20)

PDF
Insiders guide to clinical Medicine.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Pharma ospi slides which help in ospi learning
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Open folder Downloads.pdf yes yes ges yes
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Pre independence Education in Inndia.pdf
PPTX
master seminar digital applications in india
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Insiders guide to clinical Medicine.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Pharma ospi slides which help in ospi learning
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Open folder Downloads.pdf yes yes ges yes
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
COMPUTERS AS DATA ANALYSIS IN PRECLINICAL DEVELOPMENT.pptx
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Pre independence Education in Inndia.pdf
master seminar digital applications in india
Week 4 Term 3 Study Techniques revisited.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...

Use 2dimensional arrays to represent matricesSolutioni.pdf

  • 1. Use 2dimensional arrays to represent matrices Solution import java.util.*; import java.lang.*; import java.io.*; class lab5c { public static void main (String[] args) { int[][] A = {{10,55,4,89,39},{45,9,49,98,23},{4,8,90,23,9},{8,37,80,2,31}}; int[][] B = {{40,1,16},{90,3,7},{9,2,22},{44,35,60},{18,67,21}}; int[][] C = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; int sum = 0; for(int i=0;i<=4;i++) { sum = sum + A[2][i] * B[i][1]; System.out.println(sum); } C[2][1] = sum; System.out.println("C[2][1] = "+C[2][1]); }