1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
snow_lady [41]
3 years ago
12

6. Write a program to compute the sum and difference of two matrices which have the same order. Have the user enter the order of

the matrices and then have the user enter the elements in the two matrices, and then perform addition and subtraction of respective elements. You may have to use for loops to obtain the entries of the two matrices and also may have to use for loops to add/subtract the entries.
Computers and Technology
1 answer:
Nadya [2.5K]3 years ago
6 0

Answer:

see explaination

Explanation:

#include<iostream>

using namespace std;

main()

{

int rows,columns,first[10][10], second[10][10], sum[10][10],difference[10][10],i,j;

cout << "Enter number of rows:";

cin >> rows;

cout << "Enter number of columns:";

cin>> columns;

cout << "Enter the elements of first matrix\n";

for ( i = 0 ; i < rows ;i++ )

{

for ( j = 0 ; j < columns ; j++ )

cin >> first[i][j];

}

cout << "Enter the elements of second matrix\n";

for ( i = 0 ; i < rows ;i++ )

{

for ( j = 0 ; j < columns ; j++ )

cin >> second[i][j];

}

for ( i = 0 ; i < rows ;i++ )

{

for ( j = 0 ; j < columns ; j++ )

sum[i][j] = first[i][j] + second[i][j];

}

for ( i = 0 ; i < rows ;i++ )

{

for ( j = 0 ; j < columns ; j++ )

sum[i][j] = first[i][j] + second[i][j];

}

for ( i = 0 ; i < rows ;i++ )

{

for ( j = 0 ; j < columns ; j++ )

difference[i][j] = first[i][j] - second[i][j];

}

cout << "Sum of entered matrices:-\n";

for ( i = 0 ; i < rows ;i++ )

{

for ( j = 0 ; j < columns ; j++ )

cout << sum[i][j] << "\t";

cout << endl;

}

cout << "Difference of entered matrices:-\n";

for ( i = 0 ; i < rows ;i++ )

{

for ( j = 0 ; j < columns ; j++ )

cout << difference[i][j] << "\t";

cout << endl;

}

return 0;

}

see attachment for output

You might be interested in
The windows troubleshooting utility that identifies and eliminates nonessential files is called _____.
Virty [35]
I think it is Defragment
8 0
3 years ago
Read 2 more answers
An online service provider provides its users with hosted​ computers, an operating​ system, and a database management system​ (D
kondaur [170]

Answer:

<em>platform as a service (PaaS)</em>

Explanation:

Platform as a Service (PaaS) <em>is a cloud services system in which a third-party vendor offers hardware and software services</em> – usually the ones required for the production of applications – to internet users.

The hardware and software are managed by a PaaS company on its own network.

As more of a consequence, PaaS helps users to access in-house technology for designing or running a new app.

8 0
3 years ago
. Assuming each reference costs 1 byte, and each piece of data/info costs 1 byte as well. When will a doubly linked list be more
mixer [17]

Answer:

The circular individually linked list is more efficient for time sharing process ,when multiple application are running on pc it is responsibility of an output system to put all process on a list and execute them all by giving them piece of time and make them wait when cpu is selected to other process.

It will be more suitable for output system to use circular list as when it reaches to last of list it will be manually reaches to starting node or process.

Singly circular linked list is used when we are concerned with the memory as only one process will be allocated memory at once and there are no chances of process to go never-ending waiting.

Explanation:

4 0
3 years ago
What should we do to prevent software piracy?
frozen [14]

Answer:

1. Read the End User License Agreement (EULA) for each software product you purchase.

2. Purchase CD software only from reputable resellers.

3. Purchase software downloads directly from the manufacturer's website.

4. Register your software to prevent others from attempting to install your software on their computers.

5. Report piracy if you discover that software you purchased is not authentic or if you suspect that an online reseller or retail establishment is selling counterfeit software.

Link: https://www.techwalla.com/articles/how-to-stop-software-piracy

-Please mark as brainliest!- Thanks!

7 0
3 years ago
FILL IN THE BLANK
Gwar [14]

Answer:

search

Explanation:

4 0
3 years ago
Other questions:
  • Ben is writing web page content on a newly launched gaming gadget. He has to use hyperlinks to help visitors navigate to web pag
    11·1 answer
  • What is computer engineering?
    11·1 answer
  • 1 what elements of composition are under your control in photoshop
    13·1 answer
  • What are 2 main differences betweenarrays andstructs?
    7·1 answer
  • Describe two circumstances where access services might get implemented by organizations please.​
    9·1 answer
  • If you could represent yourself with one object from your home what would it be ?
    9·2 answers
  • How to deactivate the brainly account?​
    13·1 answer
  • You are a network administrator for your company. The network consists of a single Active Directory domain. All servers run Wind
    7·1 answer
  • _____ oversee the work of various types of computer professionals and must be able to communicate with people in technical and n
    5·1 answer
  • Could you tell me the family link app code to unlock a phone please?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!