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
What is the scope of each variable?
kari74 [83]

Answer:

scope of pet name is limited to pet class and color is accessible to the whole program

Explanation:

4 0
3 years ago
Read 2 more answers
How do big organizations take back their data to be reviewed after a disaster?
Jet001 [13]
Here a 5 step recovery plan, I have been in IT for 8 years

1. Create a disaster recovery team.

The team will be responsible for developing, implementing, and maintaining the DRP. A DRP should identify the team members, define each member’s responsibilities, and provide their contact information. The DRP should also identify who should be contacted in the event of a disaster or emergency. All employees should be informed of and understand the DRP and their responsibility if a disaster occurs.

2. Identify and assess disaster risks.

Your disaster recovery team should identify and assess the risks to your organization. This step should include items related to natural disasters, man-made emergencies, and technology related incidents. This will assist the team in identifying the recovery strategies and resources required to recover from disasters within a predetermined and acceptable timeframe.

3. Determine critical applications, documents, and resources.

The organization must evaluate its business processes to determine which are critical to the operations of the organization. The plan should focus on short-term survivability, such as generating cash flows and revenues, rather than on a long term solution of restoring the organization’s full functioning capacity. However, the organization must recognize that there are some processes that should not be delayed if possible. One example of a critical process is the processing of payroll.

4. Specify backup and off-site storage procedures.

These procedures should identify what to back up, by whom, how to perform the backup, location of backup and how frequently backups should occur. All critical applications, equipment, and documents should be backed up. Documents that you should consider backing up are the latest financial statements, tax returns, a current list of employees and their contact information, inventory records, customer and vendor listings. Critical supplies required for daily operations, such as checks and purchase orders, as well as a copy of the DRP, should be stored at an off-site location.

5. Test and maintain the DRP.

Disaster recovery planning is a continual process as risks of disasters and emergencies are always changing. It is recommended that the organization routinely test the DRP to evaluate the procedures documented in the plan for effectiveness and appropriateness. The recovery team should regularly update the DRP to accommodate for changes in business processes, technology, and evolving disaster risks.



summary :an organization must develop a recovery team to create a disaster recovery plan that includes identifying and assessing disaster risks, determining critical applications, and specifying backup procedures. Other procedures may be included in the plan based on the organization. The recovery team and organization must then implement the DRP and follow through on the plan procedures. The DRP should be continually tested and maintained to consistently prepare the organization for evolving disasters and emergencies.
4 0
2 years ago
Simpson is trying to solve an equation related to converting a decimal number to its hexadecimal form. He decides to utilize the
Marina86 [1]
Divide 1210 by 16  and write reminder divide until value zero 

first step divide 1210 by 16 =  10 
then 75 divide by 16 =  11
4 

we can write 4 B A 
in hexadecimal 

4 0
3 years ago
The IPv4 address scheme has enough IP addresses to give every blade of glass in the world its own unique IP. True False
Andrew [12]

Answer:

False

Explanation:

IPv4 address are composed of four octets (8 bit numbers), ranging from <em>0.0.0.0 to 255.255.255.255</em>

All those 32 bits, in decimal notation, can form a total of

2^{32} = 4,294,967,296 different addresses.

Being more than 4 billion addresses and ignoring that some addressesare reserved for special uses, even present human population almost doubles that number.

So it is safe to state that IPv4 addresses is <u>not </u>enough to give every blade of grass its own IP.

8 0
2 years ago
How can the Internet help our country to be a leader in technology?
BigorU [14]

Answer:

it can help in the aspect of making technologies to be fastly operated with fast internet connection there by it top among all other countries

4 0
2 years ago
Other questions:
  • This type of software works with end users, application software, and computer hardware to handle the majority of technical deta
    12·1 answer
  • He made me so angry when he didn’t let me make my point that I had to stalk after him.
    5·2 answers
  • 4. Written record of all transactions in your checking account
    5·2 answers
  • I need help also this counts as my second giveaway and last for today
    12·2 answers
  • Write down the stages in the information prcessing cycle in correct order​
    5·1 answer
  • Write a list comprehension statement to generate a list of all pairs of odd posi
    7·1 answer
  • Create an online order form for a car rental store and include the following items: input text box to enter the number of days i
    14·1 answer
  • If String str = "Computer Science";, then what is the value of str.substring(10);? ​
    6·1 answer
  • How to use boolean to check if math answer is correct java
    7·2 answers
  • joe is in the planning stages to make sure that an upcoming company promotion during a major sporting event will not overwhelm h
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!