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
4. What are the basic scientific principles the engineers who designed the digital scales would have needed to understand to des
tamaranim1 [39]

Answer:

Electric currents

Physical properties of metals

Influence of gravitational force on objects

Explanation:

The engineer who designed the digital scale must have a good working knowledge of the electric current, and its principle of flow through various materials, and also, factors that can affect its flow through a material (especially metals).

The physical properties of metal would have to be known by the engineer, in order to design the digital scale. The engineer must be able to predict some of the effect of the changes in the physical properties of a metal, and then use this to get some function that he wants from the digital scale, especially the effect of these physical changes on the electrical conducting ability of a metal.

The knowledge of the effect of gravitational force on objects is a must-know for the engineer. The process of scaling here on earth is very much dependent on the gravitational pull on objects downwards to the earth. This knowledge can be used to predict how much deflection this gravity forces will induce on an object towards the earth.

5 0
3 years ago
Which statement explains what causes the balloon to accelerate
victus00 [196]
The air leaving through the balloon's mouth pulls the balloon in the same direction as the exiting air, so the balloon experiences a net force. All air surrounding the balloon pushes the balloon forward.
5 0
3 years ago
The disk of radius 0.4 m is originally rotating at ωo=4 rad/sec. If it is subjected to a constant angular acceleration of α=5 ra
Lina20 [59]

Answer:32.4m/s^2

Explanation:

Given data

radius\left ( r\right )=0.4m

Intial angular velocity\left ( \omega_0\right )=4rad/s

angular acceleration\left ( \alpha\right )=5rad/s^2

angular velocity after 1 sec

\omega=\omega_0+\alpha\times\t

\omega=4+5\left ( 1\right )

\omega=9rad/s

Velocity of point on the outer surface of disc\left ( v\right )=\omega_0\timesr

v=9\times0.4 m/s=3.6m/s

Normal component of acceleration\left ( a_c\right )=\frac{v^2}{r}

a_c=\frac{3.6\times3.6}{0.4}=32.4m/s^2

3 0
4 years ago
What is the definition of a tolerance on a dimension typically found on technical drawings?
Alinara [238K]
Tolerance is the acceptable amount of dimensional variation that still allows a part to perform as designed.

Any process will have variation and depending on the severity of the function some tolerance will be very small. For example the sheet metal thickness on portion of a space shuttle will have a much tighter tolerance than the thickness of a piece of lumber to build a house. Tighter tolerance of processes typically are related to more process control (e.g. money) thus designs should be fully vetted with process team before placing on a drawing.
7 0
3 years ago
12-32 The Clear Brook High School band is holding a car wash as a fund-raiser to buy new equipment. The average time to wash a c
goldenfox [79]

Answer:

69

Explanation:

nsnsksnsksmsjkshibxff

4 0
4 years ago
Other questions:
  • Heather is troubleshooting a computer at her worksite. She has interviewed the computer’s user and is currently trying to reprod
    11·1 answer
  • The given family of functions is the general solution of the differential equation on the indicated interval.Find a member of th
    11·1 answer
  • For a flow in the xy plane, the x component of velocity is given by u = Ax2y2, where A = 0.4 m-3 · s-1, and x and y are measured
    11·1 answer
  • . A cylindrical metal specimen having an original diameter of 12.8 mm (0.505 in.) and gauge length of 50.80 mm (2.000 in.) is pu
    11·1 answer
  • You must signal [blank] before any turn or lane change.
    11·1 answer
  • Part of a good computer posture is to sit up straight with feet flat on the floor t or f
    9·1 answer
  • 1.00-L insulated bottle is full of tea at 90.08°C. You pour out one cup of tea and immediately screw the stopper back on the bot
    6·1 answer
  • 2. A
    12·1 answer
  • An electron is traveling with initial kinetic energy K in a uniform electric field. The electron comes to rest momentarily after
    12·1 answer
  • Why is it important to have knowledge on abbreviations, sign and symbols in masonry servicing job in the construction business s
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!