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
Which of the following identifies one factor that causes conventional tillage to actually be good for the environment?
Brums [2.3K]

Answer:

Farmers who use conventional tillage use compost more than other farmers.

Explanation:

Convectional tillage is good to the environment because it attains the following;

  • It increases porosity of the soil
  • It loosens the soil thus allowing proper root growth and air exchange
  • It is an effective way to incorporate manure and break sod fields
  • Tilled soils warm faster in spring
8 0
3 years ago
Steam enters an adiabatic turbine at 8 MPa and 500C with a mass flow rate of 3
Vinil7 [7]

Answer:

a)temperature=69.1C

b)3054Kw

Explanation:

Hello!

To solve this problem follow the steps below, the complete procedure is in the attached image

1. draw a complete outline of the problem

2. to find the temperature at the turbine exit  use termodinamic tables to find the saturation temperature at 30kPa

note=Through laboratory tests, thermodynamic tables were developed, these allow to know all the thermodynamic properties of a substance (entropy, enthalpy, pressure, specific volume, internal energy etc ..)  

through prior knowledge of two other properties such as pressure and temperature.  

3. Using thermodynamic tables find the enthalpy and entropy at the turbine inlet, then find the ideal enthalpy using the entropy of state 1 and the outlet pressure = 30kPa

4. The efficiency of the turbine is defined as the ratio between the real power and the ideal power, with this we find the real enthalpy.

Note: Remember that for a turbine with a single input and output, the power is calculated as the product of the mass flow and the difference in enthalpies.

5. Find the real power of the turbine

3 0
3 years ago
If a car sits out in the sun every day for a long time can light from the sun damage the car paint
Reika [66]

Answer:

i think yes it could make the color go lighter

Explanation:

6 0
3 years ago
Read 2 more answers
Which of these is not a type of socket
kotegsom [21]
You didn’t put a picture
7 0
3 years ago
PLZ ASAP WILL GIVE BRAINLIST
gavmur [86]

Answer: A, B, C & F (interacting w computers, making decisions & solving problems, evaluating information & getting information).

Explanation: Those are the correct & verified answers.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Air is compressed in the compressor of a turbojet engine. Air enters the compressor at 270 K and 58 kPa and exits the compressor
    13·1 answer
  • First step in solving frames in to solve support reactions when looking at the frame as a whole. a)- True b)-False
    9·1 answer
  • suppose a wheel with a 15 inch diameter is used to turn a water valve stem with a radius of .95 inches. What is the Mechanical a
    15·1 answer
  • 2. The initially velocity of the box and truck is 60 mph. When the truck brakes such that the deceleration is constant it takes
    12·1 answer
  • Aerospace engineers who work for certain government agencies are often required to have security clearance. Explain two reasons
    9·1 answer
  • A 200 W vacuum cleaner is powered by an electric motor whose efficiency is 70%. (Note that the electric motor delivers 200 W of
    13·1 answer
  • Consider a very long, cylindrical fin. The temperature of the fin at the tip and base are 25 °C and 50 °C, respectively. The dia
    14·1 answer
  • Kim is working on the cost estimate and feasible design options for a building. Which stage of a construction plan is Kim workin
    5·1 answer
  • PLEASE HELP
    15·2 answers
  • At a certain location, wind is blowing steadily at 7 m/s. Determine the mechanical energy of air per unit mass and the power gen
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!