SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a 07_product_matrix.pdf

BASIC OF ALGORITHM AND MATHEMATICS STUDENTS
BASIC OF ALGORITHM AND MATHEMATICS STUDENTSBASIC OF ALGORITHM AND MATHEMATICS STUDENTS
BASIC OF ALGORITHM AND MATHEMATICS STUDENTS
jainyshah20
 
Absolute inequalities
Absolute inequalitiesAbsolute inequalities
Absolute inequalities
Spainhour
 

Semelhante a 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
 

Mais de Emertxe Information Technologies Pvt Ltd

Mais de 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
 

Último

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
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 

Último (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
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
 
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
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
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
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

07_product_matrix.pdf