SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Downloaden Sie, um offline zu lesen
Team Emertxe
Advanced Pointers,
Arrays and Functions
Assignment 7
Assignment 7
Assignment 7
WAP to find the product of given matrix.
Assignment 7
WAP to find the product of given matrix.
Input:
Assignment 7
WAP to find the product of given matrix.
Input: Read no.of rows and columns for 2 arrays and read the
array elements for the Matrix A and B
Assignment 7
WAP to find the product of given matrix.
Input: Read no.of rows and columns for 2 arrays and read the
array elements for the Matrix A and B
Output:
Assignment 7
WAP to find the product of given matrix.
Input: Read no.of rows and columns for 2 arrays and read the
array elements for the Matrix A and B
Output: Print product for matrix A with matrix B.
Assignment 7
Example :-
Assignment 7
Example 1:-
Step1 : Read ‘row’ and ‘col’ for matrix A.
Assignment 7
Example 1:-
Step1 : Read ‘row’ and ‘col’ for matrix A.
row1 = 3 , col1 = 3
Assignment 7
Example 1:-
Step1 : Read ‘row’ and ‘col’ for matrix A.
row1 = 3 , col1 = 3
Step2 : Read the array elements for matrix A.
Assignment 7
Example 1:-
Step1 : Read ‘row’ and ‘col’ for matrix A.
row1 = 3 , col1 = 3
Step2 : Read the array elements for matrix A.
1 2 3
1 2 3
1 2 3
Assignment 7
Example 1:-
Step3 : Read ‘row’ and ‘col’ for matrix B.
Assignment 7
Example 1:-
Step3 : Read ‘row’ and ‘col’ for matrix B.
row2 = 3 , col2 = 3
Assignment 7
Example 1:-
Step3 : Read ‘row’ and ‘col’ for matrix B.
row2 = 3 , col2 = 3
Step4 : Read the array elements for matrix B.
Assignment 7
Example 1:-
Step3 : Read ‘row’ and ‘col’ for matrix B.
row2 = 3 , col2 = 3
Step4 : Read the array elements for matrix B.
1 1 1
2 2 2
3 3 3
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 =
1 2 3 x 2 2 2 =
1 2 3 x 3 3 3 =
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14
1 2 3 x 2 2 2 =
1 2 3 x 3 3 3 =
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14 14
1 2 3 x 2 2 2 =
1 2 3 x 3 3 3 =
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14 14 14
1 2 3 x 2 2 2 =
1 2 3 x 3 3 3 =
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14 14 14
1 2 3 x 2 2 2 = 14
1 2 3 x 3 3 3 =
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14 14 14
1 2 3 x 2 2 2 = 14 14
1 2 3 x 3 3 3 =
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14 14 14
1 2 3 x 2 2 2 = 14 14 14
1 2 3 x 3 3 3 =
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14 14 14
1 2 3 x 2 2 2 = 14 14 14
1 2 3 x 3 3 3 = 14
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14 14 14
1 2 3 x 2 2 2 = 14 14 14
1 2 3 x 3 3 3 = 14 14
Assignment 7
Example 1:-
Step5 : Calculate the product of matrix A and B.
Check (col1 == row2)
1 2 3 x 1 1 1 = 14 14 14
1 2 3 x 2 2 2 = 14 14 14
1 2 3 x 3 3 3 = 14 14 14
Assignment 7
Example 2:-
Step1 : Read ‘row’ and ‘col’ for matrix A.
row1 = 3 , col1 = 2
Step2 : Read the array elements for matrix A.
4 1
7 6
9 2
Assignment 7
Example 2:-
Step3 : Read ‘row’ and ‘col’ for matrix B.
row2 = 3 , col2 = 2
Step4 : Read the array elements for matrix B.
4 1
6 3
3 8
Assignment 7
Example 2:-
 In this example, row1 = 3, col1 = 2
row2 = 3, col2 = 2
 Here, row1 ≠ col2 and also row2 ≠ col1. So matrix
multiplication is not possible in this case.
Sample execution:-
Assignment 7
Sample execution:-
Assignment 7
Assignment 7
Pre-requisites:-
Assignment 7
Pre-requisites:-
 Pointers
Assignment 7
Pre-requisites:-
 Pointers
 2D arrays
Assignment 7
Pre-requisites:-
 Pointers
 2D arrays
 Dynamic memory allocation
Assignment 7
Pre-requisites:-
 Pointers
 2D arrays
 Dynamic memory allocation
Objective:-
Assignment 7
Pre-requisites:-
 Pointers
 2D arrays
 Dynamic memory allocation
Objective:-
 To understand the concept of DMA ,Double Pointers / 2D array.
Team Emertxe
Thank you

Weitere ähnliche Inhalte

Ähnlich wie 07_product_matrix.pdf (20)

Chapter 3 SE 2015.pptx
Chapter 3 SE 2015.pptxChapter 3 SE 2015.pptx
Chapter 3 SE 2015.pptx
 
13_median.pdf
13_median.pdf13_median.pdf
13_median.pdf
 
Determinants and matrices.ppt
Determinants and matrices.pptDeterminants and matrices.ppt
Determinants and matrices.ppt
 
chp-1-matrices-determinants1.ppt
chp-1-matrices-determinants1.pptchp-1-matrices-determinants1.ppt
chp-1-matrices-determinants1.ppt
 
BASIC OF ALGORITHM AND MATHEMATICS STUDENTS
BASIC OF ALGORITHM AND MATHEMATICS STUDENTSBASIC OF ALGORITHM AND MATHEMATICS STUDENTS
BASIC OF ALGORITHM AND MATHEMATICS STUDENTS
 
Introduction of determinant
Introduction of determinantIntroduction of determinant
Introduction of determinant
 
Form 4 Add Maths Chapter 6 Linear Law
Form 4 Add Maths Chapter 6 Linear LawForm 4 Add Maths Chapter 6 Linear Law
Form 4 Add Maths Chapter 6 Linear Law
 
Nelson maple pdf
Nelson maple pdfNelson maple pdf
Nelson maple pdf
 
0.7 Radical Expressions
0.7 Radical Expressions0.7 Radical Expressions
0.7 Radical Expressions
 
Lesson 1 matrix
Lesson 1 matrixLesson 1 matrix
Lesson 1 matrix
 
Chapter 1 Assignment Problems (DS) (1).pptx
Chapter 1 Assignment Problems (DS) (1).pptxChapter 1 Assignment Problems (DS) (1).pptx
Chapter 1 Assignment Problems (DS) (1).pptx
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
 
Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2Scilab for real dummies j.heikell - part 2
Scilab for real dummies j.heikell - part 2
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Simplex method
Simplex methodSimplex method
Simplex method
 
Datastage real time scenario
Datastage real time scenarioDatastage real time scenario
Datastage real time scenario
 
Matlab_basic2013_1.pdf
Matlab_basic2013_1.pdfMatlab_basic2013_1.pdf
Matlab_basic2013_1.pdf
 
Data structure algorithm
Data structure algorithmData structure algorithm
Data structure algorithm
 
Absolute inequalities
Absolute inequalitiesAbsolute inequalities
Absolute inequalities
 
Merge sort
Merge sortMerge sort
Merge sort
 

Mehr von Emertxe Information Technologies Pvt Ltd

Mehr von Emertxe Information Technologies Pvt Ltd (20)

premium post (1).pdf
premium post (1).pdfpremium post (1).pdf
premium post (1).pdf
 
Career Transition (1).pdf
Career Transition (1).pdfCareer Transition (1).pdf
Career Transition (1).pdf
 
10_isxdigit.pdf
10_isxdigit.pdf10_isxdigit.pdf
10_isxdigit.pdf
 
01_student_record.pdf
01_student_record.pdf01_student_record.pdf
01_student_record.pdf
 
02_swap.pdf
02_swap.pdf02_swap.pdf
02_swap.pdf
 
01_sizeof.pdf
01_sizeof.pdf01_sizeof.pdf
01_sizeof.pdf
 
06_sort_names.pdf
06_sort_names.pdf06_sort_names.pdf
06_sort_names.pdf
 
05_fragments.pdf
05_fragments.pdf05_fragments.pdf
05_fragments.pdf
 
04_magic_square.pdf
04_magic_square.pdf04_magic_square.pdf
04_magic_square.pdf
 
03_endianess.pdf
03_endianess.pdf03_endianess.pdf
03_endianess.pdf
 
02_variance.pdf
02_variance.pdf02_variance.pdf
02_variance.pdf
 
01_memory_manager.pdf
01_memory_manager.pdf01_memory_manager.pdf
01_memory_manager.pdf
 
09_nrps.pdf
09_nrps.pdf09_nrps.pdf
09_nrps.pdf
 
11_pangram.pdf
11_pangram.pdf11_pangram.pdf
11_pangram.pdf
 
10_combinations.pdf
10_combinations.pdf10_combinations.pdf
10_combinations.pdf
 
08_squeeze.pdf
08_squeeze.pdf08_squeeze.pdf
08_squeeze.pdf
 
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
07_strtok.pdf
 
06_reverserec.pdf
06_reverserec.pdf06_reverserec.pdf
06_reverserec.pdf
 
05_reverseiter.pdf
05_reverseiter.pdf05_reverseiter.pdf
05_reverseiter.pdf
 
04_itoa.pdf
04_itoa.pdf04_itoa.pdf
04_itoa.pdf
 

Kürzlich hochgeladen

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
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
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
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
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
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 

Kürzlich hochgeladen (20)

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
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
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
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
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
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
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
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 

07_product_matrix.pdf