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
saveliy_v [14]
3 years ago
10

make 2 dimensional arryas, ask for the rows and columns, then enter the values and then multiply both arrays.

Computers and Technology
1 answer:
Gemiola [76]3 years ago
6 0

Answer:

The program of this question can be given as:

Program:

#include <iostream>      //header file.

using namespace std;

int main()         //define main method.

{

   int First_matrix[10][10], Second_matrix[10][10], multiplication[10][10], rows, columns, i, j, k;  //define variable.

   cout<<"Enter the rows of matrix:";        

   cin>>rows;              //insert rows.

   cout<<"Enter the columns of matrix:";  

   cin>>columns;                        //insert columns

   cout<<"Enter elements of first matrix:"<< endl;     //inserting elements of second matrix

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

   {

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

       {

           cin >> First_matrix[i][j];

       }

   }

   cout<< "Enter elements of second matrix:"<< endl;          //inserting elements of second matrix

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

   {

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

       {

           cin >> Second_matrix[i][j];

       }

   }

   // multiplication of matrix.

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

   {

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

       {

           multiplication[i][j]=0;

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

           {

               multiplication[i][j] =multiplication[i][j] +First_matrix[i][k] * Second_matrix[k][j];

           }

       }

   }

   // Displaying matrix.

   cout<< "First Matrix: " << endl;

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

   {

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

   {

       cout<<" "<<First_matrix[i][j];

   }

   cout<<endl;

   }

   cout<< "Second Matrix: "<<endl;

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

   {

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

   {

       cout<<" "<<Second_matrix[i][j];

   }

   cout<<endl;

   }

   //Displaying multiplication of matrix.

   cout << endl << "multiplication of Matrix: " << endl;

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

   {

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

   {

       cout<<" "<<multiplication[i][j];

   }

   cout<<endl;

   }

   return 0;

}

Output:

Enter the rows of matrix: 2

Enter the columns of matrix:2  

Enter elements of first matrix: 1

2

4

3

Enter elements of  second matrix:5

4

3

1

First Matrix:

1  2

4  3

Second Matrix:

5  4

3  1

multiplication of Matrix:

11  6

29  19

Explanation:

In the above matrix (2-dimensional array) program firstly we insert the rows and columns for creating a user-defined matrix. Then we insert the first matrix by using a loop. In this loop, we used row and column that is inserted by the user. Similarly, we insert the second matrix. then we multiply the matrix. In the multiplication, we define 3 loop that is (i,j,k). first loop(i) work on the rows and the second and third loop(j,k) work on the columns. In the last first we print matrix (first, second). Then we print there multiplication.

You might be interested in
Given two integers as user inputs that represent the number of drinks to buy and the number of bottles to restock, create a Vend
Zanzabum

Answer:

import java.util.Scanner;

class Main {

 public static void main (String args[])

 {

   Scanner input = new Scanner(System.in);

   VendingMachine machine = new VendingMachine(20);

   System.out.print("Enter nr to purchase: ");

   int nrPurchased = input.nextInt();

   System.out.print("Enter nr to re-stock: ");

   int nrRestock = input.nextInt();

   machine.Transaction(nrPurchased, nrRestock);

   input.close();

 }

}

class VendingMachine {

 private int inventory;

 public VendingMachine(int initialInventory) {

   inventory = initialInventory;

 }

 public void Transaction(int nrToBuy, int nrToRestock) {

   inventory += nrToRestock - nrToBuy;

   System.out.printf("Inventory: %d bottles.\n", inventory);

 }

}

7 0
3 years ago
On many advanced routers and switches, you can implement QoS through bandwidth management, such as __________, where you control
Mila [183]

Answer:

c. traffic shaping

Explanation:

A traffic shaping system is one that allows to adapt the incoming data traffic that comes from some node of the network giving it a special treatment called conformation of accepted traffic and thus allowing the frames to be forwarded through the network of data under traffic rules without having gone through some traffic shaping method, this can be detected as non-conforming traffic at the edge of access to the discarded metropolitan network.

Traffic shaping is a mechanism that alters the traffic characteristics of the cell flow of a connection to achieve better network efficiency while maintaining QoS objectives or in order to ensure that the cell flow conforms to traffic parameters according to the leaky bucket algorithm configuration of the traffic contract. Traffic shaping can be used in ATM, for example, to reduce peak speed, limit the length of the burst by means of adequate spacing of cells over time. The use and location of this function is network specific.

5 0
3 years ago
What is the process in which a server is partitioned into smaller components
Usimov [2.4K]
I believe the answer to this is server virtualization.
4 0
4 years ago
Cameras absorb and record the reflected light from objects through a series of lenses. true or false? PLEASE HELP ASAP
mylen [45]

Answer:

True

Explanation:

Cameras absorb and record the reflected light from objects through a series of lenses, which are similar to the lenses that might be in someone's glasses

7 0
3 years ago
Read 2 more answers
Your company's IT management team is looking for an online tool to provide recommendations to save money, improve system availab
alina1380 [7]

Answer:

AWS Trusted Advisor

Explanation:

The IT management team can choose to host their system in Amazon Web Service (AWS) and utilize the AWS Trusted Advisor service to manage the resources. AWS Trusted Advisor is an online tool offered by Amazon to provide guidance to their client to manage the cloud resources by following some recommended good practices. This can save cost, improve system availability and performance and also to improve system security. AWS Trusted Advisor provide recommendation in real time and on regular basis. It will scan a client's subscribed cloud-based infrastructure and provide recommendation actions in five aspects which are cost optimization, performance, security, fault tolerance and service limits.

6 0
3 years ago
Other questions:
  • _____ refers to unsolicited commercial emails, usually sent to a large number of people with little regard to the users interest
    14·1 answer
  • When you first launch the internet, what page will open?
    9·1 answer
  • What is better apple or andriod
    11·2 answers
  • A look to different section of the same page is known as_____.
    7·1 answer
  • How many of you got the right answer from this app​
    8·1 answer
  • An option already selected by windows is called____ ( default option/ default selection)​.
    6·1 answer
  • Which of the following are examples of third party software that banks use? (Select all that apply.)
    5·1 answer
  • What is the gear ratios of a gear train with an input gear of 48 teeth and an output gear of 12?
    15·2 answers
  • The intelligence displayed by humans and other animals is termed?
    15·1 answer
  • What are the dominant InfoSec-related credentials used to document knowledge and/or experience?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!