Write a program to compute the sum of two matrices

Assignment Help Programming Languages
Reference no: EM131225977

Electrical Engineering Computer Methods Assignment

Q1. Write a program that given the following array, reverses all array elements and then prints them.

int x[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

Q2. Write a program to define a 1D array of 1000 element and fill it with a random values (using rand() function) between 1 and 1000 (integers), then searches and counts the number of values that can be exactly divided by 5. Finally print these values with their index numbers.

Q3. Write a program to compute the sum of two matrices and then print it. Firstly user will be asked to enter the order of matrix (number of rows and columns) and then two matrices.

For example if the user entered order as 2, 2 i.e. two rows and two columns and matrices as

First Matrix:-

1              2

3              4

Second Matrix:-

4              5

-1            5

Then output of the program (sum of First and Second matrix) will be

5              7

2              9

Q4. Write a program that will read five values from the keyboard (use a loop) and store them in an array of type float with the name amounts. Create two arrays of five elements of type long with the names dollars and cents. Store the whole number part of each value in the amounts array in the corresponding element of dollars and the fractional part of the amount as a two-digit integer in cents (e.g., 2.75 in amounts[1] would result in 2 being stored in dollars[1] and 75 being stored in cents[1]). Output the values from the two arrays of type long as monetary amounts (e.g., $2.75).

Reference no: EM131225977

Questions Cloud

Euro zone monetary policy : Why participating in the euro zone causes a country to give up its independent monetary policy and control over its domestic interest rates.
Exceed sales targets or production targets : Class, we reward employees who exceed sales targets or production targets. Is there any reason not to likewise reward employees who exceed safety goals and/or practices that a company has established?
What does this implyabout the size of elasticity of demand : Sales ofpleasure boats fell by nearly 90 percent in southernFlorida as prospective buyers bought boats in theBahamas to avoid paying the tax. What does this implyabout the size of the elasticity of demand?
Company general nutrition center : In this module, you have learned about with what a SWOT is, how they are conducted, and how they are used. It's now your turn to create a SWOT matrix for a company of your choice (you must NOT use the company General Nutrition Center, GNC).
Write a program to compute the sum of two matrices : EEL 2161 Electrical Engineering Computer Methods Assignment. Write a program to compute the sum of two matrices and then print it. Firstly user will be asked to enter the order of matrix (number of rows and columns) and then two matrices
Case of national federation of independent business-sebelius : Create a summary of the facts as the court found them to be in the case of National Federation of Independent Business v. Sebelius, what was the courts opinion and what type of court gave the opinion? if it was a higher court that gave the final verd..
Economic indicators that would affect : What are some economic indicators that would affect how Under Armour performs?
Consumer financial protection bureau : As a result of the Financial Reform Act of 2010, the Consumer Financial Protection Bureau was established and housed within the Federal Reserve. - Explain the role of this bureau.
Which country are you focusing : 1) Which country are you focusing? 2) What changes/innovations interest you in that country? 3) Which companies are involved?

Reviews

len1225977

9/30/2016 2:06:14 AM

You don't have to send me the C files. Just copy the programming and paste it in a word doc, so then I go myself and c&p to my C files.

Write a Review

Programming Languages Questions & Answers

  List comprehension to return a list of all the numbers

Write a higher order function list To that takes a function f and a number n and uses list comprehension to return a list of all the numbers from 1 to n for which the function fevaluates to True.

  Program that allows operator to manage print queue

You are required to write a program that allows an operator to manage a (simulated) print queue. Your program must include facilities

  Benefits of programming with objects and classes

How is it different from programming with functions alone? Write down benefits of programming with objects and classes in Web applications?

  Aggregate planning for a bottling companya bottling company

aggregate planning for a bottling companya bottling company has decided to introduce a new line of premium bottled

  Advantages of contemporary languages allow kinds of comments

Many contemporary languages allow two kinds of comments, one in which delimiters are used on both ends (for multiple line comments), and one in which a delimiter marks only the beginning of the comment.

  Program that prompts user to enter five test scores

Write the algorithm for a program that prompts the user to enter five test scores.

  Write a program that will calculate number of square feet

write a program that will calculate the number of square feet (living space) in a 4-room house. Your analysis should be clearly written and demonstrate your thought process and steps used to analyze the problem.

  Compute the total sales and commission rate applied

Write a program that prompts a salesman to enter his-her status and total sales. Compute the following: their status; total sales; commission rate applied; the commission ($) earned (the appropriate rate times the sales)

  Write program which translate letter grade into number grade

Write program which translates a letter grade into number grade. Letter grades are A, B, C, D, F, possibly followed by + or -.

  How does the use of open source products associate to the

the use of open source products and solutions is a popular topic. what is open source? identify the open source

  Design program that allows clerk to go through cards

Design a program that allows a clerk to go through the cards, entering the district for each citizen until an appropriate sentinel value is entered.

  Create a small program that uses conditions and loops

Control flow enables you to easily add conditions and loops to your programs. In this task you will create a small program that uses conditions and loops to output custom messages to users.

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