Related questions
C
Input code in "Enter code here" section
Approach
Function matrix_printer
void matrix_printer(int matrixA[][4], int matrixB[][4]) {
printf("MatrixA \t MatrixB\n");
for (int c = 0; c < 4; c++) {
for (int d = 0 ; d < 4; d++) {
//print matrixA elements
printf("%d ", matrixA[c][d]);
}
printf("\t");
for (int e = 0 ; e < 4; e++) {
//print matrixB elements
printf("%d ", matrixB[c][e]);
}
printf("\n");
}
printf("\n");
}
Function matrix_operation
void matrix_operation(int matrixA[][4], int matrixB[][4], char operator) {
printf("\nResult\n");
int matrixC[4][4];
int c,d;
if (operator == '+') //check if operator is '+'
{
for (c = 0; c < 4; c++) {
for (d = 0 ; d < 4; d++) {
matrixC[c][d] = matrixA[c][d] + matrixB[c][d]; //perform addition
printf("%d ", matrixC[c][d]); //print result
}
printf("\n");
}
}
if (operator == '-') //check if operator is '-'
{
for (c = 0; c < 4; c++) {
for (d = 0 ; d < 4; d++) {
matrixC[c][d] = matrixA[c][d] - matrixB[c][d]; //perform subtraction
printf("%d ", matrixC[c][d]); //print result
}
printf("\n");
}
}
}
Step by stepSolved in 2 steps with 2 images
- Language : C++arrow_forwardChoose corect option: Ludo is an good example of a) Dfa b) NDFA c) All d) fsmarrow_forwardData collection takes place in which of the following activities? Multiple Choice Output. Review. Input. Processing. Which of the following represents a sequential multi-instance task? Multiple Choice One employee taking pizza orders. Two baristas working at a Starbucks counter. One employee taking an order and collecting payment in a drive-through. Many customers watching one movie. Which of the following best describes the relationship between the UML class diagram and the database? Multiple Choice The relationship between cooking instructions and ingredients. The relationship between raw materials and finished goods. The relationship between a blueprint and building. The relationship between driving directions and a map.arrow_forward
- vestion 17 Control structure of a Python program: O Changes the order of execution Prints all control values Tells what happens during program execution Gives if, and while statementarrow_forwardC programming onlyarrow_forwardC++ Which function is used to check whether a character is tab or a control code?a) isspace()b) isalnum()c) iscntrl()d) isblank()arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education