matrux

© All Rights Reserved

0 views

matrux

© All Rights Reserved

- Chapter 10 Multiple-Choice Samples
- Real Secret
- 50926806 Formulario de Transformadas de Laplace (2)
- assAs
- introductiontovectors
- Documents.tips Cac Ham Thong Dung Trong Ms Excel
- Maths Notes Xii Matrices Board Exam Imp Qa
- Lec - 12 M-Band Wavelets v4.0
- Chap2 Strain
- FCschool09_Halle1
- CSEC January 2016 Mathematics P2 MS
- College Algebra Graphs and Models 5th Edition Bittinger Test Bank
- Dq0 Transform - Open Electrical
- Practicetest2-11130
- WS 01.1 Limits & Continuity
- PS2 Solutions
- LSQ
- ex3
- Math 275 Spring 2012 3-7
- summary17.pdf

You are on page 1of 2

h>

int result[10][10],;

void sum(int ar1[][10], int ar2[][10], int,int);

void difference(int ar1[][10], int ar2[][10], int, int);

void product(int ar1[][10], int ar2[][10], int, int);

void main()

{

int array1[10][10], array2[10][10], result[10][10];

int row1, col1, row2, col2, choice;

printf("Enter the number of rows in the 1st matrix\n");

scanf("%d", &row1);

printf("Enter the number of columns in the 1st matrix\n");

scanf("%d", &col1);

printf("Enter the number of rows in the 2nd matrix\n");

scanf("%d", &row2);

printf("Enter the number of columns in the 2nd matrix\n");

scanf("%d", &col2);

printf("Enter the elements of the 1st matrix\n");

for (int i = 0; i < row1; i++)

for (int j = 0; j < col1; j++)

scanf("%d", &array1[i][j]);

printf("Enter the elements of the 2nd matrix\n");

for (int i = 0; i < row2; i++)

for (int j = 0; j < col2; j++)

scanf("%d", &array2[i][j]);

if ((row1 == row2) && (col1 == col2))

sum(array1, array2, row1, col2);

else

printf("sum not allowed");

if ((row1 == row2) && (col1 == col2))

difference(array1, array2, row1, col2);

else

printf("difference not allowed");

if ((row1 == col2))

product(array1, array2, row1, col2);

else

printf("product not allowed");

}

void sum(int ar1[][10], int ar2[][10], int r, int c)

{

for (int i = 0; i < r; i++)

for (int j = 0; j < c; j++)

result[i][j] = ar1[i][j] + ar2[i][j];

printf("The sum of two matrices are\n");

for (int i = 0; i < r; i++)

{

printf("\n");

for (int j = 0; j < c; j++)

printf("%d\t", result[i][j]);

}

}

void difference(int ar1[][10], int ar2[][10], int r, int c)

{

for (int i = 0; i < r; i++)

for (int j = 0; j < c; j++)

result[i][j] = ar1[i][j] - ar2[i][j];

printf("\nThe difference of two matrices are\n");

for (int i = 0; i < r; i++)

{

printf("\n");

for (int j = 0; j < c; j++)

printf("%d\t", result[i][j]);

}

}

void product(int ar1[][10], int ar2[][10], int r, int c)

{

for (int i = 0; i < r; i++)

for (int j = 0; j < c; j++)

{

result[i][j] = 0;

for (int k = 0; k < c; k++)

result[i][j] = result[i][j] + ar1[i][k] * ar2[k][j];

}

printf("\nThe multiplication of two matrices are \n");

for (int i = 0; i < r; i++)

{

printf("\n");

for (int j = 0; j < c; j++)

printf("%d\t", result[i][j]);

}

printf("\n");

}

- Chapter 10 Multiple-Choice SamplesUploaded bybatmanbittu
- Real SecretUploaded bydurrie
- 50926806 Formulario de Transformadas de Laplace (2)Uploaded byAnthony E. Lq
- assAsUploaded byMukesh Bisht
- introductiontovectorsUploaded byapi-276566085
- Documents.tips Cac Ham Thong Dung Trong Ms ExcelUploaded byNgo Trung Vu
- Maths Notes Xii Matrices Board Exam Imp QaUploaded byaaryangarg
- Lec - 12 M-Band Wavelets v4.0Uploaded byNikesh Bajaj
- Chap2 StrainUploaded byMario
- FCschool09_Halle1Uploaded byfafdsaf
- CSEC January 2016 Mathematics P2 MSUploaded byLatoyaWatkins
- College Algebra Graphs and Models 5th Edition Bittinger Test BankUploaded bya369417428
- Dq0 Transform - Open ElectricalUploaded byHerman Damanik
- Practicetest2-11130Uploaded byshaneshane911
- WS 01.1 Limits & ContinuityUploaded byPeter Aguirre Kluge
- PS2 SolutionsUploaded byYenhao Philip Chen
- LSQUploaded byBecirspahic Almir
- ex3Uploaded byamit1kumar1barman
- Math 275 Spring 2012 3-7Uploaded byMutt3012
- summary17.pdfUploaded byDilip Kumar
- Spr 2015Uploaded by0pt618
- Assignment_5.pdfUploaded byZoravur Singh
- TransposeUploaded byAbinash Mishra
- Module 1 (Geometry)Uploaded byClarence De Leon
- Conv EsseUploaded byKhoa Nguyễn Anh
- graph 5Uploaded by伟伦
- Class16(Laplace 1)Uploaded byNikka Lopez
- Practice 2 SolutionsUploaded byJuan Carlos Merchan
- s s-7 relation versus functionUploaded byapi-253679034
- ADMATH DRAFT 1.docxUploaded byRiri Agustin

- Practice Problems on Functions (Maths)Uploaded byShlok Sah
- FA LectureUploaded byFrederico Sande Viana
- 2 Analytic FunctionUploaded byAshutosh Singh
- 08&9Uploaded bykamal hameed tayy
- Algebra 2 Part 2Uploaded byDorothy Dwyer
- Unit 6 - Minimum Spanning TreeUploaded byVaibhav Makkar
- Integrals of Functions of a Real VariableUploaded bySolomon Antoniou
- A Comparison of Vertex Ordering Algorithms for Large Graph VisualizationUploaded byharry_3k
- CombinatorialOptimizationUploaded byHenne Popenne
- CA Syllibus2Uploaded bywidhiyantirahayu
- Limits and Limit TheoremsUploaded byRoberto C. Discutido
- algebra 1 4th 9 weeks calenderUploaded byapi-281814524
- Quadratic FunctionsUploaded bySalmizam Izam
- optimizacaoUploaded byAnaPanasco
- 1687-2770-2013-10Uploaded bydurdanecoban
- Zernike PolynomialsUploaded byJoshua Cook
- Hosoya Polynomial, Wiener and Hyper-Wiener Indices of Some Regular GraphsUploaded byjournalieij
- curve fittingUploaded byNoel Daef
- Equivalence RelationsUploaded bytutorciecle123
- syllabus128aUploaded byjack
- fmod4Uploaded byVibhuti Narayan
- MCA 4th sem ADA lab mannualUploaded byNishanth Jain
- NA-Lec-15Uploaded byhamid
- CalcI Complete PracticeUploaded byJoy Edwards
- Math 151 Homework 05.pdfUploaded byNafiur Rahman
- PennCalc Main FunctionsUploaded byMaggie Zhang
- Frames and Numerical ApproximateUploaded byHarold Contreras
- hw5_slnUploaded bydeepakbvs
- AQFT_1Uploaded byNhellCerna
- 04 - Trig Ratios of Any Angle.pdfUploaded byMark Abion Valladolid