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
How can the use of local materials improve the standard of living of Filipinos?
Rudiy27
Choose a quality one, and don't use it as necessary
7 0
2 years ago
Explain the four criteria for proving the correctness of a logical pretest loop construct of the form "while B do S end". And pr
evablogger [386]

Answer:

Check the explanation

Explanation:

The loop invariant has to satisfy some amount of requirements to be of good use. Another complex factor as to why a loop is the question of loop termination. A loop that doesn’t terminate can’t invariably be correct, and in fact the computation in whatever form amounts to nothing. The total axiomatic description of a while construct will have to involve all of the following to be true, in which I is the loop invariant:

P => I

{I and B} S {I}

(I and (not B)) => Q

Then the loop terminates

6 0
3 years ago
In a surface grinding operation, the wheel diameter = 8.0 in, wheel width = 1.0 in, wheel speed = 6000 ft/min, work speed = 40 f
Katen [24]

Answer: the answer will be d because it is the right one to be

Explanation:

7 0
3 years ago
An inductor (L = 400 mH), a capacitor (C = 4.43 µF), and a resistor (R = 500 Ω) are connected in series. A 44.0-Hz AC generator
MakcuM [25]

Answer:

(A) Maximum voltage will be equal to 333.194 volt

(B) Current will be leading by an angle 54.70

Explanation:

We have given maximum current in the circuit i_m=385mA=385\times 10^{-3}A=0.385A

Inductance of the inductor L=400mH=400\times 10^{-3}h=0.4H

Capacitance C=4.43\mu F=4.43\times 10^{-3}F

Frequency is given f = 44 Hz

Resistance R = 500 ohm

Inductive reactance will be x_l=\omega L=2\times 3.14\times 44\times 0.4=110.528ohm

Capacitive reactance will be equal to X_C=\frac{1}{\omega C}=\frac{1}{2\times 3.14\times 44\times 4.43\times 10^{-6}}=816.82ohm

Impedance of the circuit will be Z=\sqrt{R^2+(X_C-X_L)^2}=\sqrt{500^2+(816.92-110.52)^2}=865.44ohm

So maximum voltage will be \Delta V_{max}=0.385\times 865.44=333.194volt

(B) Phase difference will be given as \Phi =tan^{-1}\frac{X_C-X_L}{R}=\frac{816.92-110.52}{500}=54.70

So current will be leading by an angle 54.70

5 0
3 years ago
The waffle slab is: a) the two-way concrete joist framing system. b) a one-way floor and roof framing system. c) the one-way con
GREYUIT [131]

Answer:

a) the two-way concrete joist framing system

Explanation:

A waffle slab is also known as ribbed slab, it is a slab which as waffle like appearance with holes beneath. It is adopted in construction projects that has long length, length more than 12m. The waffle slab is rigid, therefore it is used in building that needs minimal vibration.

4 0
3 years ago
Other questions:
  • The flow curve for a certain metal has parameters: strain-hardening
    8·1 answer
  • A well-insulated tank in a vapor power plant operates at steady state. Saturated liquid water enters at inlet 1 at a rate of 125
    8·1 answer
  • The pressure distribution over a section of a two-dimensional wing at 4 degrees of incidence may be approximated as follows: Upp
    9·1 answer
  • 4. Which of the following is the first thing you should do when attempting
    13·2 answers
  • The use of zeroes after a decimal point are an indicator of accuracy. a)True b)- False
    7·1 answer
  • ما جمع كلمة القوة؟help please
    10·1 answer
  • An engine has been diagnosed with blowby.
    12·1 answer
  • Does anyone know how to fix this? It's a chromebook and project where I have to try to fix it​
    9·1 answer
  • A particular electromagnetic wave travelling in vacuum is detected to have a frequency of 3 × 10 12 Hz. How much time will it ta
    6·1 answer
  • List five pieces of personal safety equipment which must be in everyday use in the workshop​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!