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
3. If nothing can ever be at absolute zero, why does the concept exist?
Tanzania [10]

The absolute zero in temperature refers to the minimal possible temperature. It is the temperature at which the molecules of a system stop moving, so it is a really useful reference point.

<h3>Why absolute zero can't be reached?</h3>

It would mean that we need to remove all the energy from a system, but to do this we need to interact with the system in some way, and by interacting with it we give it "some" energy.

Actually, from a quantum mechanical point of view, the absolute zero has a residual energy (so it is not actually zero) and it is called the "zero point". This happens because it must meet <u>Heisenberg's uncertainty principle</u>.

So yes, the absolute zero can't be reached, but there are really good approximations (At the moment there is a difference of about 150 nanokelvins between the absolute zero and the smallest temperature reached). Also, there are a lot of investigations near the absolute zero, like people that try to reach it or people that just need to work with really low temperatures, like in type I superconductors.

So, concluding, why does the concept exist?

  • Because it is a reference point.
  • It is the theoretical temperature at which the molecules stop moving, defining this as the <u>minimum possible temperature.</u>

If you want to learn more about the absolute zero, you can read:

brainly.com/question/3795971

3 0
2 years ago
Aaron needs to create a building design for a restaurant with colors that depict excitement and vibrancy. Which color can Aaron
zloy xaker [14]

Answer:

I'm no engineer, but blue and purple are cool colors and white is every color so I'd go with orange

7 0
3 years ago
Read 2 more answers
The best grade of hardwood lumber that is generally available is _____​
Vesnalui [34]

Answer:

FAS

Explanation:

first and second grade

5 0
2 years ago
Bending is defined as? A. the application of a load tending to distort a member in one direction. B. the application of opposing
amm1812
Hi how are you today
4 0
2 years ago
How deep is a 6ft hole?​
Pavlova-9 [17]

Answer:

I know this sounds quite deep but it is as deep as a grave

Explanation:

It's reality

3 0
2 years ago
Read 2 more answers
Other questions:
  • Consider the following program:
    15·1 answer
  • A metallic material with yield stress of 140 MPa and cross section of 300 mm x 100 mm, is subjected to a tensile force of 8.00 M
    12·1 answer
  • An engineer is considering time of convergence in a new Layer 3 environment design. Which two attributes must be considered? (Ch
    15·1 answer
  • What is the base unit in standard measurement
    13·2 answers
  • -0-1"<br> -0<br> -20<br> -15<br> -10<br> 0<br> -5
    9·1 answer
  • What is a rivet and how do tehey work
    14·1 answer
  • URGENT PLEASE HELP!!!
    11·1 answer
  • If y varies inversely as x, and y =23 when x=8, find y when x=4
    14·1 answer
  • A retail business, owned by share holders and having centralized decision making for their multiple store locations is called:
    13·1 answer
  • 1. Band saw lower wheel does not require a guard * true or false 2. Band saw upper guide should be adjusted to within 1/8" of th
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!