Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This code shown below only shows the result of the multiplication process, I want an additional part of the code to show me the division

This code shown below only shows the result of the multiplication process, I want an additional part of the code to show me the division process so that the user appears to have the option to press 1 to multiply and 2 to divide or another code that applies this idea as shown in the picture.
#include
using namespace std;
int main()
{
int a[10][10], b[10][10], mult[10][10], r1, c1, r2, c2, i, j, k;
cout
cin >> r1 >> c1;
cout
for (i = 0; i
{
for (j = 0; j
{
cin >> a[i][j];
}
}
cout
cin >> r2 >> c2;
cout
for (i = 0; i
{
for (j = 0; j
{
cin >> b[i][j];
}
}
for (i = 0; i
for (j = 0; j
{
mult[i][j] = 0;
}
for (i = 0; i
for (j = 0; j
for (k = 0; k
{
mult[i][j] += a[i][k] * b[k][j];
}
cout
for (i = 0; i
{
for (j = 0; j
{
cout
if (j == c2 - 1)
cout
}
}
return 0;
}
image text in transcribed
CAUsers hi source repos 1. multiplication 2.division Select multiplication

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions