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]
4 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]4 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
What is an isochoric process? b) Can heat be exchanged in an isochoric process? c) A 100L container holding an ideal gas at an i
oksano4ka [1.4K]

Answer:

a)A constant volume process is called isochoric process.

b)Yes

c)Work =0

Explanation:

Isochoric process:

 A constant volume process is called isochoric process.

In constant volume process work done on the system or work done by the system will remain zero .Because we know that work done give as

work = PΔV

Where P is pressure and ΔV is the change in volume.

For constant volume process ΔV = 0⇒ Work =0

Yes heat transfer can be take place in isochoric process.Because we know that temperature difference leads to transfer of heat.

Given that

Initial P=10 MPa

Final pressure =15 MPa

Volume = 100 L

Here volume of gas is constant so the work work done will be zero.

4 0
4 years ago
A(n) ____________________ measures the resistance to current flow in a circuit.
yulyashka [42]

Answer: OHMMETER & MEGOHMMETER:

Explanation: The ohmmeter measures circuit resistance; the megohmmeter measures the high resistance of insulation. A meter used to measure electric current. It is connected as part of a circuit.

6 0
3 years ago
Anything you want to do in Hootsuite can be found in the ________, with the main workspace in the _________?
Thepotemich [5.8K]

Answer:

Anything you want to do in Hootsuite can be found in the ___ Sidebar_____, with the main workspace in the ___center______

Sidebar; center

Explanation:

The main workspace of the Hootsuite is located in the center.  The sidebar is where the core access to the Hootsuite functionality, like Streams, Inbox, Planner, Analytics, Publisher, and the App Directory, is obtained.  Hootsuite is a media management platform for curating content, scheduling posts, managing team members, and measuring performances.

5 0
3 years ago
A discharged battery will have?
lora16 [44]
A think is the correct answer
4 0
2 years ago
Read 2 more answers
Obtain a relation for the logarithmic mean temperature difference for use in the LMTD method?
kolezko [41]

Answer:

The log mean temperature difference is:

ΔT,lm=(ΔT1-ΔT2)/㏑(ΔT1/ΔT2)

Explanation:

To evaluate the equivalent average temperature difference between two fluids we consider a parallel-flow double-pipe heat exchanger (see attached diagram). The temperature of the hot and cold fluids is large at the inlet of the heat exchanger and decreases exponentially toward the outlet.  

We can assume that the outer surface of the heat exchanger is well insulated and that heat transfer only occurs between the two fluids. We can also assume negligible kinetic and potential. The energy balance on each fluid can be written as the rate of heat loss from the hot fluid is equal to the rate of heat gained by the cold fluid in any section of the heat exchanger:

Q = -m,h×c,ph×dT,h   (1)

where Q=rate of heat loss, m=mass flow rate, c,ph=heat capacity of the hot fluid, dT,h= differential temperature of the hot fluid

Q = m,c×c,pc×T.c  (2)

where Q=rate of heat loss, m=mass flow rate, c,ph=heat capacity of the cold fluid, dT,h= differential temperature of the cold fluid

The temperature of the hot fluid change is negative and is added to make Q positive. Solving equations 1 and 2 in terms of dT:

dT.h = - Q/(m,h×c,ph)

dT.c =  Q/(m,c×c,pc)

and taking the difference:

dT,h-dT,c= d(T,h - T,c) = -Q(1/(m,h×c,ph) + 1/(m,c×c,pc)) (3)

The heat transfer rate in the differential section of the heat exchanger can be expressed as:

Q = U(T,h-T,c)×dA,s  (4)

where U=overall heat transfer coefficients, dA,s = differential sectional area. Substitute equation 4 into 3:

d(T,h - T,c)/(T,h - T,c) = -U×dA,s×(1/(m,h×c,ph) + 1/(m,c×c,pc))  (5)

Integrating equation 5:

㏑((T,h out - T,c out)/(T,h in - T,c in)) = -U×A,s×(1/(m,h×c,ph) + 1/(m,c×c,pc))  (6)

The first law of thermodynamics requires the rate of heat transfer from hot and cold fluid to be equal.

Q= m×c, pc×(T, c out-T, c in)  (7)

Q= m×c, ph×(T,h out-T, h in)   (8)

Solve equations 7 and 8 for m,c×c, pc and m,h×c, ph and substituting into equation 6:

Q = U×A,s×ΔT,lm

Where the log mean temperature difference is:

ΔT,lm=(ΔT1-ΔT2)/㏑(ΔT1/ΔT2)

Download pdf
8 0
3 years ago
Other questions:
  • Air at 35 C, 1 atm, and 50% relative humidity enters a dehumidifier operating at steady state. Saturated moist air and condensat
    13·1 answer
  • Assuming the point estimate in Problem 6.36 is the true population parameter, what is the probability that a particular assay, w
    15·1 answer
  • An eddy current separator is to separate aluminum product from an input streamshredded MSW. The feed rate to the separator is 2,
    7·1 answer
  • "Compute the flow time, tardiness, and lateness for each job, and the average flow time, average tardiness, and average lateness
    10·1 answer
  • A carbon resistor has a resistance of 976 ohms at 0 degrees C. Determine its resistance at 89 degrees C​
    6·1 answer
  • Problem the pressure at a given point is 50 mmhg absolute
    12·1 answer
  • A student lives in an apartment with a floor area of 60 m2 and ceiling height of 1.8 m. The apartment has a fresh (outdoor) air
    14·1 answer
  • You need to lower your lift onto the mechanical load-holding devices to provide structural support before working under the lift
    12·1 answer
  • Loyalty to WHICH governing model was displaced by ideas advanced in the Declaration of Independence and the U.S Constitution?
    5·2 answers
  • When servicing piston rods and pins it is important to always
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!