Write a program (using functions) starting from directives to compute and display the transpose of a matrix of dimension m x n. [Note: Here, transpose of a matrix means the element at row r and column c in the original is placed at row c and column r of the transpose]. (Programming in C)

Answers

Answer 1

Answer:

#include <iostream>

#include <cstdlib>

using namespace std;

int m, n;

void transpose(int matrix[]){

  int transp[m][n];

  for (int i = 0; i < n; i++){

     for (int j = 0; j < m; j++){

        transp[j][i] = matrix[i][j];

        cout<< transp[j][i]<< " ";

     }

     cout<< "\n";

  }

}

int main(){

  cout<< "Enter the value for n: ";

  cin>> n;

  cout>> "Enter the value for m: ";

  cin>> m;

  int mymatrix[n][m];

  for (int i = 0; i < n; i++){

     for (int j = 0; j < m; j++){

        mymatrix[i][j] = (rand() % 50);

     }

  }

  transpose(mymatrix);

}

Explanation:

The C source code defined a void transpose function that accepts a matrix or a two-dimensional array and prints the transpose on the screen. The program gets user input for the row (n) and column (m) length of the arrays. The C standard library function rand() is used to assign random numbers to the array items.


Related Questions

Write a simplified machine language program that has register $s0 loop through the numbers 0, 100, 200, ..., 500. See Lab 11 for details on submitting the simplified machine language programs.

Answers

Answer:

Explanation:

     li $s4 , 100 // Initialize register $s4 with 500 for checking the condition when $s0 is equal to 500

Loop : li $s0 , 0 // Initialize register $s0 with0

abc : addi $s0 , 100  // Add 100 to register $s0

bne $s0, $s4 , abc  // Branch to label abc if not equal to 500

beq $s0, $s4 , Loop   // Branch to label Loop if equal to 500

What are url addresses for visiting websites? And what are the different parts of a URL? Answer it in a 1-2 paragraph

Answers

A URL is a website link which consists of //https and the title of the website you are going to. A URL helps guide and memorize certain links and websites. Also some URL links are fake and give false advertisement or false information especially when looking into things that happen everyday like the news. You can tell this by seeing if the url link is a trustworthy link. I hope this helps maybe you can expand on it if it’s not long enough

Answer:

Please read explanation

Explanation:

URL is the short form for "Uniform Resource Locator". A uniform resource locator tells the location of a website to the browser.

Parts of URL:

There are three main parts of URL

ProtocolDomain nameExtension

Protocol defines the type of protocol used for communicating with the website while the domain name is the name assigned to the IP address and the mapping is stored in domain name server and extension tells the type of website i.e.

.com means commercial

.org means non-profitable organization

.edu means educational website

An additional element is path which change with the website navigation.


how to play here!!!!!!!!!!!​

Answers

Answer:

what?

Explanation:

whaaattt????????????

Answer:

Choose a platform: Playing video games no longer requires a deicated console or a gaming computer

Explanation:

Files can be stored on hard drives, network drives, or external drives, but not in the cloud.
True
False

Folders provide a method for organizing files.
True
False

Answers

The first one is false and the second is true

Answer: (1) False, (2) True

Explanation:

Eun-Joo is working on a circuit board. There is no electrical current flowing through a certain switch on the circuit board.
What state is that switch in?
binary
state 0
state 1
user mode

Answers

Answer:

state 0

Explanation:

in binary 0 is off.

Answer:

state 0

Explanation:

Multiple Choice
Which method adds an element at the beginning of a deque?
appendleft
O insertleft
O popleft
addleft

Answers

Answer: appendleft

Explanation: Edge 2021

The method that adds an element for the information at the beginning of a deque is append left. Thus option (A) is correct.

What is an information?

An information refers to something that has the power to inform. At the most fundamental level information pertains to the interpretation of that which may be sensed.

The digital signals and other data use discrete signs or alogrithms to convey information, other phenomena and artifacts such as analog signals, poems, pictures, music or other sounds, and the electrical currents convey information in a more continuous form.

Information is not knowledge itself, but its interpretation is important. An Information can be in a raw form or in an structured form as data. The information available through a collection of data may be derived by analysis by expert analysts in their domain.

Learn more about information here:

brainly.com/question/27798920

#SPJ5

What is the main advantage of using a WYSIWYG (“what you see is what you get”) editor when constructing a website?
Only one programming language is required.
Websites may have more professional construction.
Knowledge of HTML is not required.
Website templates are not necessary.

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer among the given options to this question is:

Knowledge of HTML is not required.

Because when you are constructing a website using WYSIWYG (“what you see is what you get”) editor, then you don't need the knowledge of HTML. Because, when you use WYSIWYG editor to insert button, table, images, text, paragraph, etc. It will automatically insert HTML code behind the page. For example, you can insert a form and a submit button using drag and drop with the help of WYSIWYG (“what you see is what you get”)  editor, for this purpose, you don't need exact knowledge of HTML. WYSIWYG (“what you see is what you get”)  automatically inserts the HTML for the form and button on a website page.

While other options are not correct because:

Using the WYSIWYG (“what you see is what you get”)  editor, you can use different programming languages in your website, such as VB.net, Asp.Net, C#, Javascript, Bootstrap, etc. It is not necessarily that you may have more professional construction and in WYSIWYG (“what you see is what you get”)   website templates are mostly used and modified using WYSIWYG editor.

Answer:

(C):Knowledge of HTML is not required.

A switch is a device that connects multiple computers into a network in which multiple communications links can be in operation simultaneously. True False

Answers

Answer:

True

Explanation:

A network switch is also called switching hub or a bridging hub. It is a device that connects multiple computers into a network in which multiple communications links can be in operation simultaneously. It makes use of Mac addresses in the forwarding of the data link layer (layer 2) of the OSI model. Types include managed switches, unmanaged switches, smart switches but to mention a few.

What is one feature that differentiates social media information systems (SMIS) from Web site applications? A user has to login to a Web site to use the special features. SMIS do not use browsers. A user can comment on a Web site. SMIS has more users than a Web site. SMIS has connection data

Answers

Answer:

A user has to login to a Web site to use the special features.

Explanation:

This is true because, even though website could be able to give the required information needed at that particular point in time, in order to use the special features found in the website, there is need to login into the website.

For example, Brainly which is a website needs the students to login in-order to ask his or her questions where not clarified with an expected answer gotten from the website.

what is one issue when organizing around hierarchical functions

Answers

Answer:

The one issue that arises when organizing around hierarchical functions is the dilution of information caused by the absence of direct communication with the overall boss.

Explanation:

This problem is more pronounced when it takes an organization a longer time before initiating hierarchical functions.  Employees who have grown used to communicating directly with their bosses will now be distanced from them because direct reports to the overall bosses are no longer permitted.  Instead, each functional head is expected to coordinate their group information, have it thoroughly filtered before allowing the overall boss to access it.  One advantage is that functional hierarchies eliminate information overflow.  Unfortunately, some bosses do not feel comfortable, at first, when their organizations commence hierarchical organization of business functions.

As an interviewer, it is not necessary to be at eye level with interviewee

True
False

Answers

Answer:

True

Explanation:

Have a great day

Answer:

True

Hope this helps

What kind of number is 36A

Answers

Rational
or compound what form are you looking for?

What is this screen called? (I attached a picture)
A. Y Editor Screen
B. Graph Screen
C. Window Screen
D. Table Screen

Answers

Answer:

graph screen is the correct answer

Answer:

a

Explanation:

1. It is acceptable to use a jack that has been
A) O Dropped
B) O Cracked
C) Distorted
D) None of the above

Answers

D. None of the above

Explain how the use of Git and a shared public Git repository simplifies the process of managing opensource development when many developers may be working on the same code. Support your answer with an appropriate visual that you find from the internet.

Answers

Answer:

Git is a collaborative software used by members of a group to share and work on the same projects. Github is a web application that uses git to link people working together on a codebase. With git and Github, opensource projects can be accessed and collaborated on by volunteers.

Explanation:

Opensource development is a collaborative group of developers working together on a software or platform with a general public license. When working on an opensource project, each developer is able to folk or get a copy of the repository downloaded to a local computer which they can work on and push or update to the actual online repository if the condition for a change is met.

Write Python code that asks a user how much money they spend at the store sale. If the user spends less than $75, they receive no discount. If the user spends $75 or more, they receive $15 off. If the user spends $100 or more, they receive $25 off. If the user spends $150 or more, they receive $50 off.

Answers

Answer:

5000

Explanation:

506+567=5000

If you wanted to make the system sequentially consistent, what are the key constrains you need to impose

Answers

Answer:

The call of instructions and data must be sequential, there can be no reordering of instructions but to allow reordering, a fence must be created.

Explanation:

Sequential consistent memory model is able to use instructions when or before processing is done and after processing, so long as the instruction order is sequential.

This is similar to uploading a video on you-tube, the site immediately creates a page for the video even before the video is fully uploaded. Sent tweeter messages are seen by different people at different times, but the messages appear to be arranged sequentially.

Becky's mom is a nurse and is required to wear specific clothing to work. This clothing is called

a uniform
business casual
casual
formal business attire

Answers

the answer is uniform!

hope this helps!!

You need to implement a class that represents the state of a room or game section. The class will contain a room_id, a description, and possibly a choice1 and a choice 2. You will need to implement the __str__ override to output the state of the room. You should also implement a method called game_over. If the room does have a choice 1 and choice2 then the game is over and it should return True.

Answers

Answer:

class Home(object):

   def __int__(self):

       room1()

  # room1 is the bedroom, you could either sleep or leave the room

   def room1(self):

       print("Room 1")

       choices = ['sleep', 'leave']

       for _ in iter(list, 0):

           mychoice = input("What do you want to do here sleep/leave: ")

           if mychoice == choice[0]:

               print("You are sleeping")

           elif mychoice == choice[1]:

               self. room2()

           else:

               self. game_over()

   # room2 is the living room for fun and recreation

   def room2(self):

       print("Room 2")

       choices = ['watch a movie', 'dance', 'call a friend', 'leave']

       mychoice = input("What do you want to do here: ")

       for _ in iter(list,0):

           if mychoice == choice[0]:

               print("I love this movie")

           elif mychoice == choice[1]:

               print("You are a good dancer.")

           elif mychoice == choice[2]:

               self. room1()

           else:

               self. game_over()

   # this method ends the program

   def game_over(self):

       quit()

Explanation:

The simple python object oriented program defines class with three methods room1, room2 and game_over which are all linked from the __init__ method from where the room1 is call first.

What are stored procedures? What kind of attack do stored procedures protect from? Identify two reasons why stored procedures are a good mitigation against the specific attack. g

Answers

Answer:

Stored procedures or procedures are subroutines or subprograms in SQL written by the user to accomplish a certain task. it helps to mitigate SQL injection by using markers as placeholders for data input and it streams the query statement and data separately in the database.

Explanation:

The stored procedure used in SQL is a user-defined function. Unlike built-in functions like pi(), they must be called to use them.

SQL injection in query statements is written by hackers to bypass conditions, especially when trying to gain access to other user accounts. Stored procedures use markers or placeholders to prevent this.

An algorithm whose worst-case time complexity is bounded above by a polynomial function of its size is called a(n)

Answers

Answer:

polynomial-bounded algorithms

Explanation:

There are two algorithm complexities and they are time and space complexities. They can be denoted with the big-O notation. The big-o notation for a time and space complexity gets the worst-case time and space respectively.

The time complexity gets the measure of the execution time of an algorithm. When the time function is a polynomial ( k^n + k^n-1 ...) then the algorithm is said to be a polynomial-bounded algorithm.

Gabby needs to perform regular computer maintenance. What should she do? Check all that apply.

Answers

what are the options ???????????

Answer:

all of them but B

Explanation:

Correct on edge

________________ are piece of programs or scripts that allow hackers to take control over any system.

Answers

Answer:

Exploits

Explanation:

Exploits can be explained to be a piece of programmed softwares or scripts that can give hackers the opportunity to take control over any system and exploit this system's vulnerabilities. The vulnerability scanners that hackers use includes, Nessus, Nexpose e.tc.

They use these scanners above to search for vulnerabilities.

list any three importance of computer​

Answers

Answer:

here is the answer

Explanation:

1) accurate

2) fast

3) can accomplish tasks more effencily

Explain how a stored procedure is processed by the DBMS query processor (including the type of return value after the query is processed

Answers

Answer:

The stored procedures in DBMS can be executed with;

EXEC procedure_name

It can also be executed with single or multiple arguments with

EXEC procedure_name (use the at tag here)Address= data1, (use the at tag here)Address= data2;

It returns a status value of the queried table.

Explanation:

A stored procedure is a subroutine used in SQL servers to perform a task on a table in a database or the database itself. The syntax for creating a stored procedure is;

CREATE PROCEDURE procedure_name

And then, other statements can be written to be executed when the procedure is called.

Write a second ConvertToInches() with two double parameters, numFeet and numInches, that returns the total number of inches.

Answers

Answer:

Answered in C++

double ConvertToInches(double numFeet, double numInches){

   return numFeet*12 + numInches;

}

Explanation:

A foot is equivalent to 12 inches. So, the function converts feet to inches by multiplying the number of feet by 12.

The question is answered in C++

This line defines the method with two parameters

double ConvertToInches(double numFeet, double numInches){

This line converts the input parameters to inches and returns the number of inches

   return numFeet*12 + numInches;

}

To convert 9 feet and 12 inches to inches, the main method of the program can be:

int main(){

   cout<<ConvertToInches(9,12);

   return 0;

}

This above will return 120 because: 9 * 12 + 12 = 120 inches

Write a program that calculates the average of N integers. The program should prompt the
user to enter the value for N and then afterward must enter all N numbers. If the user enters a
negative value for N, then an exception should be thrown (and caught) with the message “ N
must be positive.” If there is any exception as the user is entering the N numbers, an error
message should be displayed, and the user prompted to enter the number again.

Answers

Answer:

def Average(num):

   if num == 0:

       return 0

   val = 0

   trueNum = num

   for i in range(0, num):

       try:

           val += int(input("Enter value (%d out of %d): " % (i+1,num)))

       except Exception as e:

           print ("Error processing value. Non integer detected.")

           try:

               val += int(input("Enter value (%d out of %d): " % (i+1,num)))

           except Exception as e:

               print ("Error processing value. Non integer detected.")

               print ("OMITTING value from average.")

               trueNum -= 1

   return val/trueNum

def main():

   try:

       num = int(input("Enter a value N for amount of items: "))

       if num < 0:

           raise(ValueError)

   except ValueError:

       print ("N must be positive integer.")

       exit(1)

   print("Average: ", Average(num))

   exit(0)

if __name__ == "__main__":

   main()

Explanation:

This program is written in Python to collect some integer value from the user as an upper bound of integers to be input for an average.  Using this upper bound, the program checks to validate it is indeed an integer.  If it not an integer, then the program alerts the user and terminates.  If it is a user, the Average function is called to begin calculation.  Inside the Average function, the user is prompted for an integer value repeatedly up until the upper bound.  Using the sum of these values, the program calculates the average.  If the user inputs a non integer value, the program will alert the user that the value must be an integer and ask again.  If the user again inputs a non integer value, that iteration will be omitted from the final average.  The program this prints the calculated average to the user.

Cheers.

In Python, programmers use square brackets and an index range to slice multiple characters from a string.


True

False

Answers

(True) jgjgjgbfbfbfbdvdvdvdv

Answer:

True

Explanation:

Many electronic devices use a(n) ?, which contains all the circuit parts in a miniature form.

Answers

Answer:

An integrated circuit is a single, miniature circuit with many electronically connected components etched onto a small piece of silicon or some other semiconductive material. (A semiconductor is a nonmetallic material that can conduct an electric current, but does so rather poorly.)

Explanation:

Many electronic devices use a(n) integrated circuit which contains all the circuit parts in a miniature form.

The use of  integrated circuit is known to be a kind of a single, miniature circuit that has a lot of electronically connected parts that are designed onto a small piece of silicon or semi conductive material.

A lot of electronic components are known to be capacitors, inductors, resistors, diodes, transistors and others.

Learn more about electronic devices from

https://brainly.com/question/11314884

what does "route print" do?

Answers

Answer:Route is a Windows command that displays and updates the network routing table. These activities will show you how to use the route command to display the local routing table.

Explanation:

Other Questions
To what extent did people experience the Industrial Revolution differently? Since the 1980s and 1990s, the number of small farms operated by families have __________ as the number of corporate farms have ___________.A.remained fairly stable . . . increasedB.remained fairly stable . . . decreasedC.increased . . . decreasedD.decreased . . . increased which one of the following things is NOT an example of velocity?1. 3 miles per hour towards home2. driving south at 80 miles per hour3. riding a bicycle at 10 miles per hour4. diving downward into a pool at 5 meters per second what is a beam on a bridge? what does it do? What caused a large inflow of mennonites from russia in the late 1800's? Simplify 4 sin x cos x csc x Question 2 (1 point)Which of the following caused the creation of shantytowns, known as Hoovervilles?bresentment over the income gap between the rich and the poor led to widespread protestsdissatisfaction with the government's welfare programs in certain states led to high internal migrationwidespread unemployment and bank failures led many people to lose their homesrapid economic expansion in cities had caused a lack of affordable housing optionsd Which equation represents exponential decay?PLEASE HELP!!!I WILL HIVE BRAINLEIST IF YOU HELP round off 4827627.931 to the nearest ten thousand Classify a triangle that has 2 equal sides and two angles measuring 53 degrees?A. Isosceles and ObtuseB. Isosceles and AcuteC. Scalene and RightD. Equilateral and AcutE -10x + 10x + 5x + 5 = 5solve for x 37. A researcher believes that students who practice taking all of their regular tests on the computerwill do better on the State's final exam which is on the computer than the students taking theirregular tests by paper and pencil. Which would be the null hypothesis?a.H: The average on the state exam of the students using paper and pencil tests is greater than orequal to the average on the state exam of the students using computer tests.b. H.: The average on the state exam of the students using paper and pencil tests is greater than theaverage on the state exam of the students using computer tests.c. H: The average on the state exam of the students using paper and pencil tests is less than orequal to the average on the state exam of the students using computer tests.d. H: The average on the state exam of the students using paper and pencil tests is less than theaverage on the state exam of the students using computer tests. I need help asap... dont guess 5.00 ml of an H2SO4 solution with unknown molarity was diluted with 25.00 ml. This was tirated with 15.00ml of .1000 M NaOH to reach the equivalence point. What is the molarity of the original unknown H2SO4 solution? Also, what would the balanced chemical equation for this reaction be? A gaint kite is contrstrused using bamboo for the edges and diagonals and card for sail. When mapped on the diagram, the ends are at P(2,-2) and R(14,-14) and the diagrams intersects at M. The short diagonals Qs divides RP in the ratio 3:1 and MP = MS calculate. C.The equation of diagonals ANSWER QUICKLY!!!How did Mongol warriors use horses innovatively in battle?A. They rode armored horses B. They rode horses with no stirrupsC. They rode horses while using weapons D. They rode horses in an ordered formation What was poseidons purpose Green Mountain Producers Inc. is an oil drilling company. the company paid a dividend of $3.10 last year, and, in the past, its dividend has increased steadily by about 4% a year. Green Mountain just announced that its dividend will increase to $4.20 this year, and its share price rose from $38 per share to $40 per share immediately after the announcement. Which of the following best explains why Green Mountain's stock price increased as it did? The clientele effect Dividend irrelevance theory The signaling hypothesis Which of the following statements is true? Taxes on dividend income are paid in the year that they are received. Taxes on dividend income s are paid when the stock is sold. As a result, the U.S. tax code encourages many individual investors to prefer to receive _____ Some researchers and analysts have noticed a trend in which firms that increase their dividends see an increase in their stock price. the theory of_______ explains this phenomenon. In some cases, analysts notice that groups of similar investors tend to flock to stocks that have dividend policies consistent with their needs. This circumstance is an illustration of:________. the information content effect the clientele effect Whats 9 times 9Just gave you 100 for free your welcome What conclusion can you draw about the relationship between a percentage of the population in each estate and the percentage of land owned by that estate