1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
____ [38]
3 years ago
8

Given a matrix, clockwise-rotate elements in it. Please add code to problem3.cpp and the makefile. Use the code in p3 to test yo

ur code. Submit your code and a cpp.sh url, like in your projects and previous assignments. For the cpp.sh url, put your solution into one large program.
Input
1 2 4
5 7 8
3 6 9

Output:
4 1 2
7 5 3
8 9 6
Engineering
1 answer:
rusak2 [61]3 years ago
5 0

Answer:

/* C Program to rotate matrix by 90 degrees */

#include<stdio.h>

int main()

{

int matrix[100][100];

int m,n,i,j;

printf("Enter row and columns of matrix: ");

scanf("%d%d",&m,&n);

 

/* Enter m*n array elements */

printf("Enter matrix elements: \n");

for(i=0;i<m;i++)

{

 for(j=0;j<n;j++)

 {

  scanf("%d",&matrix[i][j]);

 }

}

 

/* matrix after the 90 degrees rotation */

printf("Matrix after 90 degrees roration \n");

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

{

 for(j=m-1;j>=0;j--)

 {

  printf("%d  ",matrix[j][i]);

 }

 printf("\n");

}

 

return 0;

 

}

You might be interested in
Many farms and ranches use electric fences to keep animals from getting into or out of specific pastures. When switched on, an e
Nikolay [14]

Answer:

Aluminum

Explanation:

The best material to use when creating an electric fence would be Aluminum. Aluminum wiring is incredibly durable and can be easily obtained. Since aluminum is a non-magnetic metal its conducting capabilities far exceed other metallic options in the market and is also why companies choose aluminum for their high tension cable wiring. Aside from being more expensive than other feasible options its durability and conducting capabilities make it easily the best option.

7 0
3 years ago
Read 2 more answers
Which of the following best distinguishes between superficial design improvements and functional
Contact [7]

Answer:

Superficial design improvements are typically only trivial changes to a design, while functional design improvements can change the way a product or process is used to significantly enhance performance.

Explanation:

As a PC board designer, I would sometimes spend a certain amount of time making traces have shorter routes, or fewer layer changes or bends. (I wanted to make the layout "pretty.") In some cases, these changes are superficial, affecting the appearance only. In some cases, they are functional, reducing crosstalk or emissions or susceptibility to interference.

I deal with a web site that seems to be changing all the time (Brainly). In many cases, the same information is rearranged on the page—a superficial change. In other cases, the information being displayed changes, or the way that certain information is accessed changes. These are functional changes. (Sometimes, they "enhance performance," and sometimes they don't, IMO.)

In short ...

<em>Superficial design improvements are typically only trivial changes to a design, while functional design improvements can change the way a product or process is used to significantly enhance performance.</em>

8 0
2 years ago
A transmission line (TL) of length L and conductance per unit length G' is connected to an ideal constant voltage generator V. T
Andru [333]

Answer:

The Current will decrease by a factor of 2

Explanation:

Given the conditions, it should be noted that the current in the circuit is determined by the LOAD. In other words, the amount of current generator will be producing depends upon the load connected to it.

Now, as the question says, the load is reduced to half its original value, we can write:

P1 = \sqrt{3} (V) (I1) Cos\alpha ----- (1)

P2 = \sqrt{3} (V) (I2) Cos\alpha\\

Since, P2 = P1/2,

P1/2 = \sqrt{3} (V) (I2) Cos\alpha ----- (2)\\

Dividing equations (1) and (2), we get,

P1 / (P1/2) = I1/ I2

I2 = I1 / 2\\

Hence, it is proved that the current in the transmission line will decrease by a factor of 2 when load is reduced to half.

7 0
3 years ago
Engineering is the use of scientific principles to design and build machines, structures, and other items, including bridges, tu
Thepotemich [5.8K]

Is this a question or a statement?

4 0
3 years ago
A 4.4 HP electric motor spins a shaft at 2329 rpm. Find: The torque load carried by the shaft is closest to: Select one: a)-27.0
harina [27]

Answer:

Load carried by shaft=9.92 ft-lb

Explanation:

Given:    Power P=4.4  HP

                    P=3281.08 W

<u><em>Power:  </em></u>Rate of change of work with respect to time is called power.

We know that P=Torque\times speed

     \omega=\frac{2\pi N}{60} rad/sec

So that P=\dfrac{2\pi NT}{60}

So   3281.08=\dfrac{2\pi \times 2329\times T}{60}

      T=13.45 N-m         (1 N-m=0.737 ft-lb)

 So T=9.92 ft-lb.

Load carried by shaft=9.92 ft-lb

3 0
3 years ago
Other questions:
  • What is Not considered as metric system ? a. Length b. Mass c. Time d. Volume e. Temperature
    9·2 answers
  • The nameplate on a 70 kVA transformer shows a primary voltage of 480 volts and a secondary voltage of 115 volts. We wish to dete
    10·1 answer
  • Describe what V1-V4 is
    10·1 answer
  • Design a digital integrator using the impulse invariance method. Find and give a rough sketch of the amplitude response, and com
    15·1 answer
  • If changing employment what do you need to do? Email your new employer information to the Deptartment of International Graduate
    5·1 answer
  • True or false the camshaft is always located in the engine block
    10·1 answer
  • How many ase certifications are there for automotive technicians?
    7·1 answer
  • Hey answer quick for 20 points
    7·2 answers
  • An unknown relative passes away and bequeaths upon you a small tract of land in Amherst. You decide to build a two-story storage
    14·1 answer
  • What is a beta testing ?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!