Question

L7 8 9] 142 48 54) 2. Write a code for the subtraction of 2 matrices [2 x 3). Both matrices elements should be given by the u

could you please if it's possible to attach the answer in cpp form.
Thank you in advanced.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include<iostream> using namespace std; int main() {        int m1[2][3], m2[2][3];         cout<<"Enter first matrix elements: "<<endl;        for(int i=0;i<2;i++)         {               for(int j=0;j<3;j++)                 {                       cin>>m1[i][j];            }       }       cout<<"Enter second matrix elements: "<<endl;       for(int i=0;i<2;i++)         {               for(int j=0;j<3;j++)                 {                       cin>>m2[i][j];            }       }   /* subtract m2 from m2 matrix and store data into m1 */ for(int i=0;i<2;i++) {   for(int j=0;j<3;j++)         {               m1[i][j]=m1[i][j]-m2[i][j];             }       }       /* print m1 matrix */   cout<<"Subtraction of two matrices: "<<endl;        for(int i=0;i<2;i++) {       for(int j=0;j<3;j++)         {               cout<<m1[i][j]<<" ";                }               cout<<endl;       }       return 0; }

Exter 28- mateix elemente: U D lo Enter second mateix elements: Subtraction of two matrices: ... Program finished with exit c

Add a comment
Know the answer?
Add Answer to:
could you please if it's possible to attach the answer in cpp form. Thank you in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • ***Java Project*** Please upload the entire code and attach the screenshots of the code. The screenshots help me to write the code, so please attach that. Thank you so much. If you could use the comme...

    ***Java Project*** Please upload the entire code and attach the screenshots of the code. The screenshots help me to write the code, so please attach that. Thank you so much. If you could use the comment to explain the code, it would be perfect! Thank you so much~ Design and code a Swing GUl for a two-player tic-tac-toe (noughts and crosses) game on a 3 x 3 game board. The JFrame should use a BorderLayout with a JLabel in the...

  • In C++ please! Please include .cpp and .hpp files! Thank you! Recursive Functions Goals Create and...

    In C++ please! Please include .cpp and .hpp files! Thank you! Recursive Functions Goals Create and use recursive functions In this lab, we will write a program that uses three recursive functions. Requirements: Important: You must use the array for this lab, no vectors allowed. First Recursive Function Write a function that recursively prints a string in reverse. The function has ONLY one parameter of type string. It prints the reversed character to the screen followed by a newline character....

  • C Thank You for You x Home - OwNet x B Assignment 401 X CPP-A01 -...

    C Thank You for You x Home - OwNet x B Assignment 401 X CPP-A01 - Dynam x ASM-103 - Intege X ASM-A03 - Integex Calculus - Find voll x D (10) Disc method X + -ox + → C onedrive.live.com/view.aspx?resid-322690C11EFFEB37!1631&ithint-file%2cdocxêauthkey-!AOJByR3MAP202A Word Sign in OneDrive CPP-A01 - Dynamic Multiplication Table Accessibility Mode Download Save to OneDrive Print ... When completing this assignment, the student should demonstrate mastery of the following concepts: • Visual Studio Project Creation • C++ Formatted Output...

  • You will need those four files: d_node.h, d_nodel.h, d_random.h, and prg9_1.cpp Program Definition 1. Create program...

    You will need those four files: d_node.h, d_nodel.h, d_random.h, and prg9_1.cpp Program Definition 1. Create program definition with the following templates and methods: // returns the sum of all elements in a single linked list template <typename T> int sum(node<T> *front); // outputs the nodes of a single linked list in reverse order. template <typename T> void outputReverse(node<T> *front); Main Method: add before the "cout << "\nOutput in Descending Order: ";" line call sum() to print sum of all elements...

  • Please help me to do my assignment it should be python. Thank you Write a menu-driven...

    Please help me to do my assignment it should be python. Thank you Write a menu-driven program for Food Court. (You need to use functions!) Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!) Ask the user what he/she wants and how many of it. (Check the user inputs) AND Use strip() function to strip your inputs. Keep asking the user until he/she chooses...

  • In C++ 1. Write a program that allows a user to enter 10 integer values from...

    In C++ 1. Write a program that allows a user to enter 10 integer values from the keyboard. The values should be stored in an array. 2. The program should then ask the user for a number to search for in the array: The program should use a binary search to determine if the number exists in a list of values that are stored in an array (from Step #1). If the user enters a number that is in the...

  • Files given in this assignment (right-click on the file to download) Assignment7.cpp (need to complete) Student.h...

    Files given in this assignment (right-click on the file to download) Assignment7.cpp (need to complete) Student.h (Given. Just use it, don't change it!) Student.cpp (Partially filled, need to complete) 1. Assignment description In this assignment, you will write a simple class roster management system for ASU CSE100. Step #1: First, you will need to finish the design of class Student. See the following UML diagram for Student class, the relevant header file (class declaration) is given to you as Student.h,...

  • please answer correctly and follow the code structure given [JavaFX/ Exception handing and text I/O] 1....

    please answer correctly and follow the code structure given [JavaFX/ Exception handing and text I/O] 1. Write a program for the following. NOTE that some of these steps are not dependent on each other. Using methods is mandatory. Make sure to use methods where it makes sense. a. Ask the user for a series of integers entered from the keyboard. Use a sentinel value such as 999 to end the input process. If the entered values are not integers, throw...

  • Please complete on Excel and show any computations Thank you 1. Shop online for your dream...

    Please complete on Excel and show any computations Thank you 1. Shop online for your dream car and get its price. Attach documentation on the price (screen print). 2. Shop around (online) for financing and select the best financing rate available for a 4-year (48 months) loan. Attach documentation on financing rates. (Do not apply for actual loan – this is simply an exercise) 3. Pay 10% down. How much are you financing today? 4. Using MS Excel features, compute...

  • C# WINDOWS FORMS APPLICATION (not CONSOLE APPLICATION ) (Please screenshot window form of this program and...

    C# WINDOWS FORMS APPLICATION (not CONSOLE APPLICATION ) (Please screenshot window form of this program and write code on computer. Thank you very much !) For this week's assignment , create and complete a Windows application for the following question. Airline Reservation System: An airline has just bought a computer for its new reservation system. Develop a new system to assign seats on the new airplane( capacity: 10 seats) Display the following alternatives: "Please type 1 for first class, and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT