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
The advantages of solar cells include all of the following, except a.moderate net energy yield b.little or no direct emissions o
Xelga [282]

Answer:

C

Explanation:

One of the disadvantages of solar cells is that electricity storage systems are not readily available. Excess energy generated by the solar panels are wasted except they are stored by solar batteries for later use. There are various systems for storing electricity from solar cells apart from solar batteries which is the common storage system. An example of another electricity storage system for solar cell is using the water electrolyzer to store solar energy which can be used to later generate hydroelectricity.

Advantages of a solar cell includes Renewable energy, Economy-friendly and environmental-friendly energy and good durability

6 0
3 years ago
Answer?...................
torisob [31]

Answer:

The correct option is;

c. Leaving the chuck key in the drill chuck

Explanation:

A Common safety issues with a drill press leaving the chuck key in the drill chuck

It is required that, before turning the drill press power on, ensure that chuck key is removed from the chuck. A self ejecting chuck key reduces the likelihood of the chuck key being accidentally left in the chuck.

It is also required to ensure that the switch is in the OFF position before turning plugging in the power cable

Be sure that the chuck key is removed from the chuck before turning on the power. Using a self-ejecting chuck key is a good way of insuring that the key is not left in the chuck accidentally. Also to avoid accidental starting, make sure the switch is in the OFF position before plugging in the cord. Always disconnect the drill from the power source when making repairs.

5 0
3 years ago
What type of models can be communicated in more than one way.
guajiro [1.7K]
A 3-D model can be communicated, and can also be a visual model.
4 0
3 years ago
Sketch T-s and p-v diagrams for the Diesel cycle.
labwork [276]

Answer:

Diesel cycle:

    All diesel engine works on diesel cycle.It have four processes .These four processes are as follows

1-2.Reversible adiabatic compression

2-3.Heat addition at constant pressure

3-4.Reversible adiabatic expansion

4-1.Heat addition at constant volume

When air inters in the piston cylinder after that it compresses and gets heated due to compression after that heat addition take place at constant pressure after that power is produces when piston moves to bottom dead center.

From the diagram of P-v And T-s we can understand so easily.

3 0
3 years ago
Air enters a diffuser operating at steady state at 540°R, 15 lbf/in.2, with a velocity of 600 ft/s, and exits with a velocity of
yKpoI14uk [10]

Answer: Hello the question is incomplete below is the missing part

Question:  determine the temperature, in °R, at the exit

answer:

T2= 569.62°R

Explanation:

T1 = 540°R

V2 = 600 ft/s

V1 = 60 ft/s

h1 = 129.0613  ( value gotten from Ideal gas property-air table )

<em>first step : calculate the value of h2 using the equation below </em>

assuming no work is done ( potential energy is ignored )

h2 = [ h1 + ( V2^2 - V1^2 ) / 2 ] * 1 / 32.2 * 1 / 778

∴ h2 = 136.17 Btu/Ibm

From Table A-17

we will apply interpolation

attached below is the remaining part of the solution

8 0
2 years ago
Other questions:
  • A tank contains 350 liters of fluid in which 50 grams of salt is dissolved. Pure water is then pumped into the tank at a rate of
    8·1 answer
  • A vehicle experiences hard shifting. Technician A says that the bell housing may be misaligned. Technician B says that incorrect
    5·1 answer
  • Why is it a good idea to lock your doors while driving?<br> WRITER
    10·1 answer
  • A room is cooled by circulating chilled water through a heat exchanger located in the room. The air is circulated through the he
    15·1 answer
  • g An analog voice signal, sampled at the rate of 8 kHz (8000 samples/second), is to be transmitted by using binary frequency shi
    12·1 answer
  • Please Help !!
    5·1 answer
  • Pointssss 100 and brainliest :)
    5·1 answer
  • Which of the following machine parts always require
    12·1 answer
  • What the minimum wire size for a general residential application on a 20 A circuit
    7·1 answer
  • The minimum recommended standards for the operating system, processor, primary memory (RAM), and storage capacity for certain so
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!