Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please, Using C, not C+ or C++, Thanks. Files to submit: mat_add.c Time it took Matthew to Complete: 10 mins Requriements Program must compile with

Please, Using C, not C+ or C++, Thanks.

Files to submit: mat_add.c

Time it took Matthew to Complete: 10 mins

Requriements

Program must compile with both -Wall and -Werror options enabled

Submit only the files requested

Use doubles to store real numbers

Print all doubles to 2 decimal points unless stated otherwise

Restrictions

No global variables may be used

Your main function may only declare variables and call other functions

Description

Write a program that adds two matrices together. If you don't know how matrix addition works you can see this website for details: http://www.purplemath.com/modules/mtrxadd.htm

Details

The user will enter input in the following order

The number of rows

The number of columns

The values of matrix A

The values of matrix B

The maximum size of a matrix is 100 X 100

The matrices will not always be square (have the same number of rows and columns)

The matrix will be entered one line at a time

Assumptions

Input WILL always be valid

The values in the matrices will be integers

Examples

User input is underlined.

Example 1

Please enter the number of rows: 2 Please enter the number of columns: 2 Enter Matrix A 1 2 3 4 Enter Matrix B 100 200 200 400 A + B = 101 202 203 404

Example 2

Please enter the number of rows: 2 Please enter the number of columns: 3 Enter Matrix A 10 20 -30 1 2 7 Enter Matrix B 1 2 30 -3 4 5 A + B = 11 22 0 -2 6 12

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

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions