Write a program to multiply two matrices.

Assignment Help C/C++ Programming
Reference no: EM13937655

You are going to write a program to multiply two matrices.
The matrices are stored in a two-dimensional array:
int[][] matrixA
int[][] matrixB

Recall:
Here is the way to declare a two-dimensional array:
int testArray[3][4] = {{1,2,3,4},{2,3,4,1},{5,4,3,0}}; // three rows, four columns
/*
after declaration, testArray will be like:
1 2 3 4
2 3 4 1
5 4 3 0
*/

This link may help you recall how to multiply two matrices
https://en.wikipedia.org/wiki/Matrix_multiplication
Your program should be like this:

/*
this program multilies two matrices
*/
#include <iostream>
/* include other libs */

using namespace std;

int main()
{
/* step1: declare three arrays here:
matrixA (3*4), 3 rows, 4 columns
matrixB (4*3),
and result (3*3)
*/

/* step2: compute the result */

/* step3: output the result */
}

The values of matrices in your program can be hard-coded and any numbers you like(including the numbers of columns/rows and the values of matrices), which means you do not have to ask user to input those numbers. Of course you can do this if you would like to.

Reference no: EM13937655

Questions Cloud

Directors to position audiences : After researching a topic of your choice with a focus on the techniques used by writers and directors to position audiences,you are to write an analytical exposition in which you:
What has happened to the price of crude oil in 2015 : What has happened to the price of crude oil in 2015? What has happened to the demand for crude oil in 2015? Is there an economic theory that supports this relationship? Support your answer with a diagram.
What is the rate of interest is charging : Idlewild Bank has granted you a seven year loan for $50,000. If your seven annual end of the year payments are $11,660.45, what is the rate of interest Idlewild is charging
Effect of appropriate strategic models : 1: Evaluate the importance and effect of appropriate strategic models to organisations. 2: Achieve a depth of critical analysis of a given situation.
Write a program to multiply two matrices. : The values of matrices in your program can be hard-coded and any numbers you like(including the numbers of columns/rows and the values of matrices), which means you do not have to ask user to input those numbers. Of course you can do this if you w..
In order to qualify for the favorable tax treatment : In order to qualify for the favorable tax treatment of a Foreign Sales Corporation, a U.S. firm must meet all of the following tests, except: a. at least one director must be a nonresident of the U.S. b. its income must be derived from qualified expo..
How does an x-ray make an image of the body : How does an x-ray make an image of the body? It should in a powerpoint slide show because im gonna present it and the assignment has to be explained u.
What is your portfolio return : Year-to-date, Yum Brands had earned a 4.40 percent return. During the same time period, Raytheon earned 4.93 percent and Coca-Cola earned −0.60 percent. If you have a portfolio made up of 40 percent Yum Brands, 40 percent Raytheon, and 20 percent Coc..
What is net present value of project : HealthWorks Inc, a chain of workout facilities, is looking at a new type of exercise equipment for all of its stores. The total amount of investment will be $250 today and the equipment is expected to last for 5 years with no salvage value. What is t..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program to enter number of values to be processed

Write c++ statements to permit the user to enter n, the number of values to be processed; then assign the anonymous array of n double values, storing its address in doublPtr.

  Questionnbsp the template method pattern and the strategy

questionnbsp the template method pattern and the strategy pattern both abstract some computation in the form of

  Write a mips program that uses a recursive implementation

Write a MIPS program that uses a recursive implementation of quick sort to sort an array of numbers. The values of the array will be given to you via standard input. The first number will be the number of elements in the array and followed by the ..

  Function that returns a token when it is needed.

A major component of your assignment will be to write a procedure (Function) that returns a token when it is needed. Your lexer should return a record, one field for the token and another field the actual "value" of the token (lexeme), i.e. the in..

  Create the roman.h and implement roman class in roman.cpp

Create the roman.h and implement the Roman class in roman.cpp. Make sure that you put in measures to prevent multiple inclusion of the header file. Test your implementation using task2a.cpp.

  Allow single play a simple two dice game of chance against

Write a program that allows a single Player (the user) to play a simple two dice game of chance against

  Write a computer program as a win32 console application

Write a computer program as a Win32 console application in C to take a depth (in kilometers) inside the earth as input data; then evaluate and display the temperature at this depth in degrees Celsius and degrees Fahrenheit. The relevant formulas a..

  Uses the sieve of eratosthenes algorithm

Write a complete program that uses the Sieve of Eratosthenes algorithm to list all prime numbers from 1 to 1,000 .

  Create a text adventure game that uses pointers

Create a text adventure game that uses pointers. You have a rich, eccentric Uncle Billy who is soon to be deceased.

  Design an employee class that has fields for name

Design an Employee class that has fields for the following pieces of information: Employee Name and Employee Number

  Write cpp code to build wireframe model of uts-feit building

Write a C++ code segment to build a wireframe model of UTS-FEIT building using OpenGL built-in graphics primitives from the Boundary-Representation (B-reps) approach.

  Demonstrates steps to analyze the problem

Demonstrates your thought process and steps used to analyze the problem. Be sure to include the required input and output and how you will obtain the required output from the given input

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd