#include<stdio.h>
void matrix_mul(float m1[10][10],float
m2[10][10],int,int,int);
void matrix_add(float m1[10][10],float m2[10][10],int,int);
void matrix_sub(float m1[10][10],float m2[10][10],int,int);
void main()
{
float m1[10][10],m2[10][10],m3[10][10];
int i,j,k,r,c,c2,choose; //r=rows of m1,m2 c=cols of m1,m2 c=rows
of m3 c2=cols of m3
printf("Enter the no.of rows and columns for matrix 1:\n");
scanf("%d%d",&r,&c);
printf("Dimensions of matrix 1: %dX%d",r,c);
printf("\nEnter the elements of the matrix 1:\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%f",&m1[i][j]);
}
}
//dimensions of matrix 1 and matrix 2 are equal
printf("dimensions of marix 2: %dX%d",r,c);
printf("\nEnter elements of matrix 2:\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%f",&m2[i][j]);
}
}
//cols of 1st matrix=rows of 3rd matrix
printf("no.of rows of matrix 3: %d",c);
printf("\nEnter the no.of columns for matrix 3:\n");
scanf("%d",&c2);
printf("Dimensions of matrix 3: %dX%d:",c,c2);
printf("\nEnter elements of matrix 3:\n");
for(i=0;i<c;i++)
{
for(j=0;j<c2;j++)
{
scanf("%f",&m3[i][j]);
}
}
printf("1.multiply\n2.addition\n3.subtraction\nEnter(1 to
3):");
scanf("%d",&choose);
if(choose==1)
matrix_mul(m1,m3,r,c,c2);
else if(choose==2)
matrix_add(m1,m2,r,c);
else if(choose==3)
matrix_sub(m1,m2,r,c);
}
void matrix_mul(float m1[10][10],float m3[10][10],int r,int c,int
c2)
{
float mul[10][10];
int i,j,k;
for(i=0;i<r;i++)
{
for(j=0;j<c2;j++)
{
mul[i][j]=0;
for(k=0;k<c;k++)
{
mul[i][j]=mul[i][j]+m1[i][k]*m3[k][j];
}
}
}
printf("multiplication of matrix 1 and matrix 3:\n");
for(i=0;i<r;i++)
{
for(j=0;j<c2;j++)
{
printf("%f\t",mul[i][j]);
}
printf("\n");
}
}
void matrix_add(float m1[10][10],float m2[10][10],int r,int
c)
{
float add[10][10];
int i,j;
for (i = 0; i < r; i++)
for (j = 0; j < c; j++)
add[i][j] = m1[i][j] + m2[i][j];
printf("Addition of matrix 1 and matrix 2\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
printf("%f\t",add[i][j]);
printf("\n");
}
}
void matrix_sub(float m1[10][10],float m2[10][10],int r,int
c)
{
float sub[10][10];
int i,j;
for (i = 0; i < r; i++)
for (j = 0; j < c; j++)
sub[i][j] = m1[i][j] - m2[i][j];
printf("subtraction of matrix 1 and matrix 2\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
printf("%f\t",sub[i][j]);
printf("\n");
}
}
![1 3 #include<stdio.h> 2 void matrix_mul(float m1[10][10], float m2[10][10], int, int, int); void matrix_add(float m1[10][10],](http://img.homeworklib.com/questions/d8974a80-996f-11eb-8c29-0b8e1d6e435c.png?x-oss-process=image/resize,w_560)
![{ } 36 for(i=0;i<c;i++) 379 { 38 for(j=0; j<c2; j++) 39 40 scanf(%f,&m3[i][j]); 41 42 43 printf(1.multiply\n2. addition\n3](http://img.homeworklib.com/questions/d94772e0-996f-11eb-9dab-6fa0157cb132.png?x-oss-process=image/resize,w_560)

![95 void matrix_sub(float m1[10][10], float m2[10][10], int r, int c) 96 ? { 97 float sub[10][10]; 98 int i, j; 99 for (i = 0;](http://img.homeworklib.com/questions/daaa1cc0-996f-11eb-b00f-7f161f488d73.png?x-oss-process=image/resize,w_560)

Problem 3 (20 pts) It is required to write a Matrix Calculator Program using C Programming...
It is required to write a Matrix Calculator Program using C Programming Language that could only perform addition, subtraction, and multiplication of two matrices of appropriate dimensions. Your program should prompt the user to select a matrix operation from a list of options that contains the aforementioned operations. Then, the user should be prompted to enter the dimensions of the two operand matrices. Next, your program should prompt the user to enter the elements of each matrix row-wise. Your program...
Write a C program to implement matrix multiplication operations. First, you need to prompt the user for the size of both matrix. Then take inputs for both matrices and perform matrix multiplication operation. Finally, print the resulting matrix into the output.
Write a c++ program: Many mathematical problems require the addition, subtraction, and multiplication of two matrices. Write an ADT Matrix. You may use the following class definition: const int MAX_ROWS = 10; const int MAX_COLS = 10; class MatrixType { public: MatrixType(); void MakeEmpty(); void SetSize(int rowsSize, int colSize); void StoreItem(int item, int row, int col); void Add(MatrixType otherOperand, MatrixType& result); void Sub(MatrixType otherOperand, MatrixType& result); void Mult(MatrixType otherOperand, MatrixType& result); void Print(ofstream& outfile); bool AddSubCompatible(MatrixType otherOperand); bool MultCompatible(MatrixType otherOperand);...
using Eclipse c++ Write a program that mimics a simple integer calculator using the switch statement. The program should prompt for two integer numbers and the operation to be performed as input. It should then output the numbers, the operator, and the results as illustrated below. Use a for loop to prompt the user for input seven times as illustrated below. Assume that the operands will always be valid integers. For division,the program should also output the remainder and check...
Problem: Design and write a C language program that can be used to calculate Voltage, Current and Total Resistance for a Series or Parallel or a Series Parallel circuit. The program should display the main menu that contains the three types of circuit calculations that are available and then the user will be prompted to select a circuit first. After the circuit has been selected the program should then display another menu (i.e., a submenu) requesting the necessary data for...
Write a C++ program to keep records and perform statistical analysis for a class of 20 students. The information of each student contains ID, Name, Sex, quizzes Scores (2 quizzes per semester), mid-term score, final score, and total score. The program will prompt the user to choose the operation of records from a menu as shown below: ============================================== MENU =============================================== 1. Add student records 2. Delete student records 3. Update student records 4. View all student records 5. Calculate...
this is a C++ program!
You will write a program that performs the following tasks for a simple mathematical calculator: (1) Open a user-specified file for input. Prompt for the name of the file, read it into a string variable, echo print it to the terminal and then open it. If the file is not opened, enter into a loop that prints out an error message, resets the input file stream variable (see the hints section), obtains a new file...
Kindly solve this using C PROGRAMMING ONLY.
4. Write a program marks.c which consists of a main function and three other functions called. readmarks , changemarks (, and writemarks() The program begins by calling the function readmarks () to read the input file marksin. txt which consists of a series of lines containing a student ID number (an integer) and a numeric mark (a float). Once the ID numbers and marks have been read into arrays (by readmarks () the...
A Simple Calculator Summary: Write a console program (character based) to do simple calculations (addition, subtraction, multiplication and division) of two numbers, using your understanding of Java. Description: You need to write a program that will display a menu when it is run. The menu gives five choices of operation: addition, subtraction, multiplication, division, and a last choice to exit the program. It then prompts the user to make a choice of the calculation they want to do. Once the...
please help me with this java problem. using java write an interactive program that will monitor the ?ow of patients in a large hospital. The program should account for patients who check in and out of the hospital and should allow access to information about a given patient. In addition, the program should manage the scheduling of three operating rooms. Doctors make a request that includes a patient’s name and a priority value between 1 and 10 that re?ects the...