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
Sinks must be used for the correct intended purpose to prevent
irakobra [83]

Answer:

... spilling water or getting anything cascading onto the floor

8 0
3 years ago
Which contemporary jazz artist was one of the first to use a synthesizer in their recording
ivolga24 [154]

Answer:

In this era, Sun Ra was among the first of any musicians to make extensive and pioneering use of synthesizers and other various electronic keyboards; he was given a prototype Minimoog by its inventor, Robert Moog.

Explanation:

3 0
2 years ago
Who will win the Copa America 2021 and Euros 2021?
Bess [88]
Brazil will win copa America
4 0
3 years ago
Hogden is conducting an experiment to determine how much force it takes for a nail to puncture a tire, causing a flat. He uses f
SashulF [63]

Answer:

B

Explanation:

8 0
3 years ago
Read 2 more answers
What is 7/8 + 1/2 on a ruler
Ad libitum [116K]

Answer:

11/8

Explanation:

7/8+4/8=11/8 if you want it on a ruler you need to go online and type fraction to decimal converter and put in 11/8 into a decimal

8 0
3 years ago
Read 2 more answers
Other questions:
  • A turbine operates at steady state, and experiences a heat loss. 1.1 kg/s of water flows through the system. The inlet is mainta
    6·1 answer
  • For a copper-silver alloy of composition 25 wt% Ag-75 wt% Cu and at 775°C (1425°F) do the following:
    15·1 answer
  • A mechanical system comprises three subsystems in series with reliabilities of 98, 96, and 94 percent. What is the overall relia
    10·1 answer
  • Why it is important to prepare first the materials and tools carpentry before doing the tasks?​
    6·2 answers
  • 4 points
    13·1 answer
  • The complexity of bfs and dfs
    11·1 answer
  • What happens to the electrolyte, during discharging?
    9·1 answer
  • Tech A says that a mechanical pressure regulator exhausts excess fluid back to the transmission pan. Tech B says that if the tra
    9·1 answer
  • A skull and crossbones pictogram indicates this kind of information about a chemical.
    14·1 answer
  • Explain race condition..<br><br>don't spam..​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!