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 is true about modern hydraulic lifts?
kaheart [24]

The modern hydraulic lifts make use of biodegradable fluid to transmit hydraulic power

<em>Question: The options are left out in the question. The details and facts about the modern hydraulic lift are presented here</em>

<em />

Details about the modern hydraulic lifts include;

The development of the  modern hydraulic occurred in the Industrial Revolution to perform task done previously by steam powered elevators  

The power of the hydraulic lift come from the hydraulic cylinder known as the actuator, which in turn is powered by pressurized hydraulic fluid such as oil

The hydraulic fluid is pushed by a piston rod through which energy is capable of being transferred, such that the applied force is multiplied, to provide more power for lifting

<u>Facts about the modern hydraulic lifts include;</u>

  • The dry motor in the modern hydraulic lift is more efficient and consumes 20% less energy
  • It comprises of valves that are controlled electronically such that the response is much rapid and the energy consumption is reduced by a further 20%
  • The cars used in the modern lift are lighter, as well as the slings, which reduces the power usage by 20%
  • It makes use of chemicals which are environmentally friendly as hydraulic fluid
  • The flash point of the fluid used is higher, as well as it posses 50% lower compressibility as well elasticity

Learn more here:

brainly.com/question/16942803

6 0
2 years ago
Determine the velocity of the 13-kgkg block BB in 4 ss . Express your answer to three significant figures and include the approp
Anvisha [2.4K]

Answer:

The question has some details missing : The 35-kg block A is released from rest. Determine the velocity of the 13-kgkg block BB in 4 ss . Express your answer to three significant figures and include the appropriate units. Enter positive value if the velocity is upward and negative value if the velocity is downward.

Explanation:

The detailed steps and appropriate calculation is as shown in the attached file.

6 0
3 years ago
Why were the French and Dutch colonized areas so small compared to the Spanish colonized areas?
Degger [83]
The French and Dutch colonized arenas so small compared to the Spanish colonized areas For farming
4 0
3 years ago
Read 2 more answers
A certain robot can perform only 4 types of movement. It can move either up or down or left or right. These movements are repres
Olegator [25]

Answer:

def theRoundTrip(movement):

   x=0

   y=0

   for i in movement:

       if i not in ["U","L","D","R"]:

           print("bad input")

           return

       if i=="U":

           y+=1

       if i=="L":

           x-=1

       if i=="D":

           y-=1

       if i=="R":

           x+=1

   return x==0 and y==0

8 0
3 years ago
If a 2 1/8 inch diameter medium carbon steel rod is to be turned between centers to a 2 inch diameter using high speed cutting b
Crank

Answer:

I think 1 31/32

8 0
4 years ago
Other questions:
  • In javaWrite a program that simulates flipping a coin to make decisions. The input is how many decisions are needed, and the out
    9·1 answer
  • Write down one metal or alloy that is best suited for each of the following applications:
    8·1 answer
  • Technician A says that when using an impact wrench to remove a bolt from the front of an engine's crankshaft, the crankshaft mus
    15·1 answer
  • Que es resistencia ?
    15·1 answer
  • Consider a normal shock wave in air. The upstream conditions are given by M1=3, p1 = 1 atm, and r1 = 1.23 kg/m3. Calculate the d
    15·1 answer
  • A geothermal heat pump absorbs 15 KJ/s of heat from the Earth 15 m below a house. This heat pump uses a 7.45 kJ/s compressor.
    5·2 answers
  • What is the angular velocity (in rad/s) of a body rotating at N r.p.m.?
    13·1 answer
  • Why won't Brainly let me make a account or log in? It's always telling me that it can't take my registration at this time or it
    9·1 answer
  • An apple, potato, and onion all taste the same if you eat them with your nose plugged
    8·2 answers
  • What is the most important part of a successful Election Day?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!